diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 124b46dfe56744f0cd879aa95f07bd094ac5cecd..18c3d36a2eedee0b80895d33287ca932bfd1a790 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,36 +1,88 @@ -image: "python:3.5" - -before_script: - # Check and print Python version - - python --version - # Create SSH configuration directory if necessary (also parents with -p, mode: read/write/exec): - - mkdir -p --mode=700 ~/.ssh/ - # Add SSH key for jutil: - - echo "$ID_RSA_JUTIL_PRIVATE" > ~/.ssh/id_rsa_jutil - # Provide read access to owner (octal value code: 400) to jutil key and known_hosts with chmod: - - chmod 400 ~/.ssh/id_rsa_jutil - # Configure SSH to use ~/.ssh/jutil_key for iffgit.fz-juelich.de (-e allows \n): - - echo -e "Host iffgit.fz-juelich.de\n\tIdentityFile ~/.ssh/id_rsa_jutil\n" > ~/.ssh/config - # Add iffgit.fz-juelich.de to known_hosts (not the same key as Jutil!): - - echo iffgit.fz-juelich.de,134.94.161.83 "$ID_RSA_IFFGIT_PUBLIC" > ~/.ssh/known_hosts - # Provide read access to owner (octal value code: 400) to known_hosts with chmod: - - chmod 400 ~/.ssh/known_hosts - # Install jutil via secure ssh connection: - - pip install git+ssh://gitlab@iffgit.fz-juelich.de/unger/jutil.git - stages: - test -test: +before_script: + # Create SSH configuration directory if necessary (also parents with -p, mode: read/write/exec): + - mkdir -p --mode=700 ~/.ssh/ + # Add SSH key for jutil: + - echo "$ID_RSA_JUTIL_PRIVATE" > ~/.ssh/id_rsa_jutil + # Provide read access to owner (octal value code: 400) to jutil key and known_hosts with chmod: + - chmod 400 ~/.ssh/id_rsa_jutil + # Configure SSH to use ~/.ssh/jutil_key for iffgit.fz-juelich.de (-e allows \n): + - echo -e "Host iffgit.fz-juelich.de\n\tIdentityFile ~/.ssh/id_rsa_jutil\n" > ~/.ssh/config + # Add iffgit.fz-juelich.de to known_hosts (not the same key as Jutil!): + - echo iffgit.fz-juelich.de,134.94.161.83 "$ID_RSA_IFFGIT_PUBLIC" > ~/.ssh/known_hosts + # Provide read access to owner (octal value code: 400) to known_hosts with chmod: + - chmod 400 ~/.ssh/known_hosts + # Install necessary apps like git and mesa-utils (needed for GL): + # TODO: Check if this is still needed after removing mayavi!? + - apt-get update + - apt-get install -y curl bzip2 git mesa-utils + +test_miniconda: stage: test + image: continuumio/miniconda3 script: - # TODO: Different jobs with custom develop arguments? extra_requires (hyperspy, plotting)? - # TODO: Use pip install -e .[hyperspy], etc. - # Install requirements: - # - pip install -r requirements.txt # TODO: DOES NOT WORK (because mayavi and stuff...) - - pip install -e .['tests'] + # Install requirements for pyramid: + - conda info --envs + - conda env create -q # -q: quiet/ no progressbar, because it spams the log! + - source activate pyramid + - conda info --envs + - conda uninstall mayavi vtk -y # TODO: necessary, because mayavi does not play nice with qt5! + - conda install pyqt=5 # TODO: This is needed for tests to run, but breaks mayavi (not used)! + # Install jutil via secure ssh connection: + - pip install git+ssh://gitlab@iffgit.fz-juelich.de/unger/jutil.git + # Execute tests: - python setup.py test + # Create coverage report: - coverage html artifacts: paths: - htmlcov/ + +test_conda_ubuntu: + stage: test + image: ubuntu:16.04 + script: + # Install miniconda: + - curl -O -L https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh + - chmod +x Miniconda3-latest-Linux-x86_64.sh + - ./Miniconda3-latest-Linux-x86_64.sh -b -p /opt/miniconda3 + - export PATH="/opt/miniconda3/bin:${PATH}" + # Install requirements for pyramid: + - conda info --envs + - conda env create -q # -q: quiet/ no progressbar, because it spams the log! + - source activate pyramid + - conda info --envs + - conda uninstall mayavi vtk -y # TODO: necessary, because mayavi does not play nice with qt5! + - conda install pyqt=5 # TODO: This is needed for tests to run, but breaks mayavi (not used)! + # Install jutil via secure ssh connection: + - pip install git+ssh://gitlab@iffgit.fz-juelich.de/unger/jutil.git + # Execute tests: + - python setup.py test + +test_pip_minimal: + stage: test + image: python:3.5 + script: + # TODO: Different jobs with custom develop arguments? extra_requires (hyperspy, plotting)? + # TODO: Use pip install -e .[hyperspy], etc. + # Install requirements: + - pip install -e .['tests'] # TODO: other case with ['all']? After getting rid of mayavi... + # Install jutil via secure ssh connection: + - pip install git+ssh://gitlab@iffgit.fz-juelich.de/unger/jutil.git + # Execute tests: + - python setup.py test + +test_pip_requirements: + stage: test + image: python:3.5 + script: + # Install requirements: + - pip install -r requirements.txt # TODO: mayavi/pyfftw commented out by hand to make work! + # Install jutil via secure ssh connection: + - pip install git+ssh://gitlab@iffgit.fz-juelich.de/unger/jutil.git + # Execute tests: + - python setup.py test + +# TODO: What about windows? Better have one test (miniconda?) for windows/max/linux, each! diff --git a/environment.yml b/environment.yml index 481a5327822503bc8a52de30d54d3fd84c359da2..da82e3d1620f87b8fc82f24e6872465625fa1c93 100644 --- a/environment.yml +++ b/environment.yml @@ -2,6 +2,7 @@ # This file contains the top level dependencies of the pyramid project! # requirements.txt also contains sub-dependencies, generated by "pip freeze > requirements.txt"! # Add new dependencies here, then "conda env update", then "pip freeze > requirements.txt"! +# To see if compatible upgrades are available for the current packages, use "conda upgrade --all"! # When packages are deprecated/deleted, it may be best to recreate the environment from scratch! name: pyramid @@ -23,13 +24,13 @@ dependencies: # File IO: - hyperspy=1.3 - hyperspy-gui-ipywidgets=1.0 - - hyperspy-gui-traitsui=1.0 # TODO: Optional! Delete when mayavi is gone! + # - hyperspy-gui-traitsui=1.0 # TODO: Optional! Delete when mayavi is gone! - h5py=2.7 # Plotting and colors: # TODO: Shift to plotting package? - - matplotlib=2.0 # Only works with qt4 from conda-forge channel! + - matplotlib=2.0 # Only conda-forge channel has working version for qt4! - Pillow=4.1 - cmocean=1.1 - - qt=4.8 # Necessary because of traits in mayavi... + - qt=4.8 # Necessary because of traits in mayavi... On server, pyqt=5.6 is needed! - mayavi=4.5 # TODO: Get rid of! #- colorspacious # TODO: NOT USED? #- visvis # TODO: NOT USED? @@ -50,9 +51,3 @@ dependencies: # - pip: # # ALSO NEEDS JUTIL! # - "git+ssh://gitlab@iffgit.fz-juelich.de/unger/jutil.git" -# -# # FOLLOWING NOT USED ANYMORE, CONDA WORKS, TOO (with appropriate channels): -# # Install pyFFTW=0.10 from wheel: -# - http://www.lfd.uci.edu/~gohlke/pythonlibs/pyFFTW‑0.10.4‑cp35‑cp35m‑win_amd64.whl -# # Install mayavi=4.5 and VTK from wheel: -# - http://www.lfd.uci.edu/~gohlke/pythonlibs/mayavi‑4.5.0+vtk71‑cp35‑cp35m‑win_amd64.whl diff --git a/pyramid/analytic.py b/pyramid/analytic.py index 28b8abd717ccb43d00cda0b4ffe71391662f4db2..8cfde7ea3385d1d8dd9ab24dd26f8dd4889c7f43 100644 --- a/pyramid/analytic.py +++ b/pyramid/analytic.py @@ -164,8 +164,7 @@ def phase_mag_sphere(dim, a, phi, center, radius, b_0=1): r = np.hypot(x - x0, y - y0) result = coeff * R ** 3 / (r + 1E-30) ** 2 * ( (y - y0) * np.cos(phi) - (x - x0) * np.sin(phi)) - # TODO: During testing: "RuntimeWarning: invalid value encountered in power": - result *= np.where(r > R, 1, (1 - (1 - (r / R) ** 2) ** (3. / 2.))) + result *= 1 - np.clip(1 - (r / R) ** 2, 0, 1) ** (3. / 2.) return result # Process input parameters: diff --git a/pyramid/file_io/io_vectordata.py b/pyramid/file_io/io_vectordata.py index 9fec4da4b575bf1a7a54daa591b70df77101826a..f128fc9081d7453c475da31cd0a3082b05541a03 100644 --- a/pyramid/file_io/io_vectordata.py +++ b/pyramid/file_io/io_vectordata.py @@ -155,11 +155,15 @@ def _load_from_ovf(filename, a): field = np.asarray((x_mag, y_mag, z_mag)) * float(header.get('valuemultiplier', 1)) if a is None: # TODO: If transferred to HyperSpy, this has to stay in Pyramid reader! - if not header.get('xstepsize') == header.get('ystepsize') == header.get('zstepsize'): - _log.warning('Grid spacing is not equal in x, y and z (x will be used)!') - a = float(header.get('xstepsize', 1.)) - meshunit = header.get('meshunit', 'nm') - a *= {'m': 1e9, 'mm': 1e6, 'µm': 1e3, 'nm': 1}[meshunit] # Conversion to nm + xstep = float(header.get('xstepsize')) + ystep = float(header.get('ystepsize')) + zstep = float(header.get('zstepsize')) + if not np.allclose(xstep, ystep) and np.allclose(xstep, zstep): + _log.warning('Grid spacing is not equal in x, y and z (x will be used)!\n' + 'Found step sizes are x:{}, y:{}, z:{} (all in {})!'.format( + xstep, ystep, zstep, header.get('meshunit'))) + # Extract grid spacing from xstepsize and convert according to meshunit: + a = xstep * {'m': 1e9, 'mm': 1e6, 'µm': 1e3, 'nm': 1}[header.get('meshunit', 'nm')] return VectorData(a, field) diff --git a/pyramid/kernel.py b/pyramid/kernel.py index 08c844bf4aa5c34997739627816b42711e758a22..7bb72410d3b30f16150cbd885e13f8efc6774207 100644 --- a/pyramid/kernel.py +++ b/pyramid/kernel.py @@ -101,15 +101,18 @@ class Kernel(object): u = np.linspace(-(u_dim - 1), u_dim - 1, num=2 * u_dim - 1) v = np.linspace(-(v_dim - 1), v_dim - 1, num=2 * v_dim - 1) uu, vv = np.meshgrid(u, v) + # TODO: u, v are coordinates, rename self.u/v to self.kern_u/v! self.u = np.empty(self.dim_kern, dtype=dtype) self.v = np.empty(self.dim_kern, dtype=dtype) self.u[...] = coeff * self._get_elementary_phase(geometry, uu, vv, a) + # TODO: The minus sign belongs into the phasemapper (debatable)! self.v[...] = coeff * -self._get_elementary_phase(geometry, vv, uu, a) # Include perturbed reference wave: if prw_vec is not None: uu += prw_vec[1] vv += prw_vec[0] self.u[...] -= coeff * self._get_elementary_phase(geometry, uu, vv, a) + # TODO: The minus sign belongs into the phasemapper (debatable)! self.v[...] -= coeff * -self._get_elementary_phase(geometry, vv, uu, a) # Calculate Fourier trafo of kernel components: self.u_fft = fft.rfftn(self.u, self.dim_pad) @@ -128,6 +131,7 @@ class Kernel(object): def _get_elementary_phase(self, geometry, n, m, a): self._log.debug('Calling _get_elementary_phase') + # TODO: Rename n m to p q ? if geometry == 'disc': in_or_out = ~ np.logical_and(n == 0, m == 0) return m / (n ** 2 + m ** 2 + 1E-30) * in_or_out diff --git a/pyramid/plottools.py b/pyramid/plottools.py index 896feb64d4e21ea8e43ae7649b55fefdf06003ed..e76ad26803bee8982dcd6b9196560bd719f1f633 100644 --- a/pyramid/plottools.py +++ b/pyramid/plottools.py @@ -28,13 +28,14 @@ FIGSIZE_DEFAULT = (6.7, 5) # TODO: Apparently does not fit as well as before... FONTSIZE_DEFAULT = 20 STROKE_DEFAULT = None - +# TODO: Replace by matplotlib styles! def pretty_plots(figsize=None, fontsize=None, stroke=None): """Set IPython formats (for interactive and PDF output) and set pretty matplotlib font.""" from IPython.display import set_matplotlib_formats set_matplotlib_formats('png', 'pdf') # png for interactive, pdf, for PDF output! mpl.rcParams['mathtext.fontset'] = 'stix' # Mathtext in $...$! mpl.rcParams['font.family'] = 'STIXGeneral' # Set normal text to look the same! + # TODO: set 'font.size' = FONTSIZE! Does this change everything relative to this value??? mpl.rcParams['figure.max_open_warning'] = 0 # Disable Max Open Figure warning! if figsize is not None: global FIGSIZE_DEFAULT diff --git a/requirements.txt b/requirements.txt index f563088ee85d902dc1e559ea43e36cf71445fd93..a7a140da6af72fc9e99e85dcc965b1b48411abb4 100644 Binary files a/requirements.txt and b/requirements.txt differ diff --git a/setup.cfg b/setup.cfg index 800d7c28c7363803630aaec51c3590f2ddba41fc..9d1fde482e54774b4c93a9336bf0b5618b423fa5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,7 +32,7 @@ test=pytest branch = True source = pyramid omit = - pyramid/tests/* + tests/* [tool:pytest] addopts = --cov --flake8 diff --git a/setup.py b/setup.py index d255b8147607dfc9a4f5672a578362875bd1e2cb..9215f6416193d34fb70817024740b3e186fc9ab2 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ import re import subprocess import sys import itertools -from distutils.command.build import build +#from distutils.command.build import build #import numpy from setuptools import setup, find_packages @@ -150,8 +150,8 @@ extras_require["all"] = list(itertools.chain(*list(extras_require.values()))) print('\n-------------------------------------------------------------------------------') -print('checking requirements') -check_requirements() +# print('checking requirements') # TODO: Get rid of! +# check_requirements() print('write version.py') write_version_py() setup(name=DISTNAME, @@ -168,6 +168,6 @@ setup(name=DISTNAME, #tests_require=['pytest', 'pytest-cov', 'pytest-flake8'], install_requires=install_requires, extras_require=extras_require, - cmdclass={'build': build} # TODO: necessary? + #cmdclass={'build': build} # TODO: necessary? ) print('-------------------------------------------------------------------------------\n') diff --git a/pyramid/tests/test_analytic.py b/tests/test_analytic.py similarity index 100% rename from pyramid/tests/test_analytic.py rename to tests/test_analytic.py diff --git a/pyramid/tests/test_analytic/ref_phase_disc.npy b/tests/test_analytic/ref_phase_disc.npy similarity index 100% rename from pyramid/tests/test_analytic/ref_phase_disc.npy rename to tests/test_analytic/ref_phase_disc.npy diff --git a/pyramid/tests/test_analytic/ref_phase_slab.npy b/tests/test_analytic/ref_phase_slab.npy similarity index 100% rename from pyramid/tests/test_analytic/ref_phase_slab.npy rename to tests/test_analytic/ref_phase_slab.npy diff --git a/pyramid/tests/test_analytic/ref_phase_sphere.npy b/tests/test_analytic/ref_phase_sphere.npy similarity index 100% rename from pyramid/tests/test_analytic/ref_phase_sphere.npy rename to tests/test_analytic/ref_phase_sphere.npy diff --git a/pyramid/tests/test_analytic/ref_phase_vort.npy b/tests/test_analytic/ref_phase_vort.npy similarity index 100% rename from pyramid/tests/test_analytic/ref_phase_vort.npy rename to tests/test_analytic/ref_phase_vort.npy diff --git a/pyramid/tests/test_costfunction.py b/tests/test_costfunction.py similarity index 100% rename from pyramid/tests/test_costfunction.py rename to tests/test_costfunction.py diff --git a/pyramid/tests/test_costfunction/hess_ref.npy b/tests/test_costfunction/hess_ref.npy similarity index 100% rename from pyramid/tests/test_costfunction/hess_ref.npy rename to tests/test_costfunction/hess_ref.npy diff --git a/pyramid/tests/test_costfunction/jac_ref.npy b/tests/test_costfunction/jac_ref.npy similarity index 100% rename from pyramid/tests/test_costfunction/jac_ref.npy rename to tests/test_costfunction/jac_ref.npy diff --git a/pyramid/tests/test_costfunction/jac_vec_ref.npy b/tests/test_costfunction/jac_vec_ref.npy similarity index 100% rename from pyramid/tests/test_costfunction/jac_vec_ref.npy rename to tests/test_costfunction/jac_vec_ref.npy diff --git a/pyramid/tests/test_costfunction/phasemap_ref.hdf5 b/tests/test_costfunction/phasemap_ref.hdf5 similarity index 100% rename from pyramid/tests/test_costfunction/phasemap_ref.hdf5 rename to tests/test_costfunction/phasemap_ref.hdf5 diff --git a/pyramid/tests/test_costfunction/zero_vec_cost.npy b/tests/test_costfunction/zero_vec_cost.npy similarity index 100% rename from pyramid/tests/test_costfunction/zero_vec_cost.npy rename to tests/test_costfunction/zero_vec_cost.npy diff --git a/pyramid/tests/test_dataset.py b/tests/test_dataset.py similarity index 100% rename from pyramid/tests/test_dataset.py rename to tests/test_dataset.py diff --git a/pyramid/tests/test_dataset/phase_vec_ref.npy b/tests/test_dataset/phase_vec_ref.npy similarity index 100% rename from pyramid/tests/test_dataset/phase_vec_ref.npy rename to tests/test_dataset/phase_vec_ref.npy diff --git a/pyramid/tests/test_fielddata.py b/tests/test_fielddata.py similarity index 100% rename from pyramid/tests/test_fielddata.py rename to tests/test_fielddata.py diff --git a/pyramid/tests/test_fielddata/magdata_flipx.hdf5 b/tests/test_fielddata/magdata_flipx.hdf5 similarity index 100% rename from pyramid/tests/test_fielddata/magdata_flipx.hdf5 rename to tests/test_fielddata/magdata_flipx.hdf5 diff --git a/pyramid/tests/test_fielddata/magdata_flipy.hdf5 b/tests/test_fielddata/magdata_flipy.hdf5 similarity index 100% rename from pyramid/tests/test_fielddata/magdata_flipy.hdf5 rename to tests/test_fielddata/magdata_flipy.hdf5 diff --git a/pyramid/tests/test_fielddata/magdata_flipz.hdf5 b/tests/test_fielddata/magdata_flipz.hdf5 similarity index 100% rename from pyramid/tests/test_fielddata/magdata_flipz.hdf5 rename to tests/test_fielddata/magdata_flipz.hdf5 diff --git a/pyramid/tests/test_fielddata/magdata_orig.hdf5 b/tests/test_fielddata/magdata_orig.hdf5 similarity index 100% rename from pyramid/tests/test_fielddata/magdata_orig.hdf5 rename to tests/test_fielddata/magdata_orig.hdf5 diff --git a/pyramid/tests/test_fielddata/magdata_ref_load.hdf5 b/tests/test_fielddata/magdata_ref_load.hdf5 similarity index 100% rename from pyramid/tests/test_fielddata/magdata_ref_load.hdf5 rename to tests/test_fielddata/magdata_ref_load.hdf5 diff --git a/pyramid/tests/test_fielddata/magdata_ref_load.txt b/tests/test_fielddata/magdata_ref_load.txt similarity index 100% rename from pyramid/tests/test_fielddata/magdata_ref_load.txt rename to tests/test_fielddata/magdata_ref_load.txt diff --git a/pyramid/tests/test_fielddata/magdata_rotx.hdf5 b/tests/test_fielddata/magdata_rotx.hdf5 similarity index 100% rename from pyramid/tests/test_fielddata/magdata_rotx.hdf5 rename to tests/test_fielddata/magdata_rotx.hdf5 diff --git a/pyramid/tests/test_fielddata/magdata_roty.hdf5 b/tests/test_fielddata/magdata_roty.hdf5 similarity index 100% rename from pyramid/tests/test_fielddata/magdata_roty.hdf5 rename to tests/test_fielddata/magdata_roty.hdf5 diff --git a/pyramid/tests/test_fielddata/magdata_rotz.hdf5 b/tests/test_fielddata/magdata_rotz.hdf5 similarity index 100% rename from pyramid/tests/test_fielddata/magdata_rotz.hdf5 rename to tests/test_fielddata/magdata_rotz.hdf5 diff --git a/pyramid/tests/test_forwardmodel.py b/tests/test_forwardmodel.py similarity index 100% rename from pyramid/tests/test_forwardmodel.py rename to tests/test_forwardmodel.py diff --git a/pyramid/tests/test_forwardmodel/jac.npy b/tests/test_forwardmodel/jac.npy similarity index 100% rename from pyramid/tests/test_forwardmodel/jac.npy rename to tests/test_forwardmodel/jac.npy diff --git a/pyramid/tests/test_forwardmodel/phasemap_ref.hdf5 b/tests/test_forwardmodel/phasemap_ref.hdf5 similarity index 100% rename from pyramid/tests/test_forwardmodel/phasemap_ref.hdf5 rename to tests/test_forwardmodel/phasemap_ref.hdf5 diff --git a/pyramid/tests/test_kernel.py b/tests/test_kernel.py similarity index 100% rename from pyramid/tests/test_kernel.py rename to tests/test_kernel.py diff --git a/pyramid/tests/test_kernel/ref_u.npy b/tests/test_kernel/ref_u.npy similarity index 100% rename from pyramid/tests/test_kernel/ref_u.npy rename to tests/test_kernel/ref_u.npy diff --git a/pyramid/tests/test_kernel/ref_u_fft.npy b/tests/test_kernel/ref_u_fft.npy similarity index 100% rename from pyramid/tests/test_kernel/ref_u_fft.npy rename to tests/test_kernel/ref_u_fft.npy diff --git a/pyramid/tests/test_kernel/ref_v.npy b/tests/test_kernel/ref_v.npy similarity index 100% rename from pyramid/tests/test_kernel/ref_v.npy rename to tests/test_kernel/ref_v.npy diff --git a/pyramid/tests/test_kernel/ref_v_fft.npy b/tests/test_kernel/ref_v_fft.npy similarity index 100% rename from pyramid/tests/test_kernel/ref_v_fft.npy rename to tests/test_kernel/ref_v_fft.npy diff --git a/pyramid/tests/test_magcreator.py b/tests/test_magcreator.py similarity index 100% rename from pyramid/tests/test_magcreator.py rename to tests/test_magcreator.py diff --git a/pyramid/tests/test_magcreator/ref_disc_x.npy b/tests/test_magcreator/ref_disc_x.npy similarity index 100% rename from pyramid/tests/test_magcreator/ref_disc_x.npy rename to tests/test_magcreator/ref_disc_x.npy diff --git a/pyramid/tests/test_magcreator/ref_disc_y.npy b/tests/test_magcreator/ref_disc_y.npy similarity index 100% rename from pyramid/tests/test_magcreator/ref_disc_y.npy rename to tests/test_magcreator/ref_disc_y.npy diff --git a/pyramid/tests/test_magcreator/ref_disc_z.npy b/tests/test_magcreator/ref_disc_z.npy similarity index 100% rename from pyramid/tests/test_magcreator/ref_disc_z.npy rename to tests/test_magcreator/ref_disc_z.npy diff --git a/pyramid/tests/test_magcreator/ref_ellipse_x.npy b/tests/test_magcreator/ref_ellipse_x.npy similarity index 100% rename from pyramid/tests/test_magcreator/ref_ellipse_x.npy rename to tests/test_magcreator/ref_ellipse_x.npy diff --git a/pyramid/tests/test_magcreator/ref_ellipse_y.npy b/tests/test_magcreator/ref_ellipse_y.npy similarity index 100% rename from pyramid/tests/test_magcreator/ref_ellipse_y.npy rename to tests/test_magcreator/ref_ellipse_y.npy diff --git a/pyramid/tests/test_magcreator/ref_ellipse_z.npy b/tests/test_magcreator/ref_ellipse_z.npy similarity index 100% rename from pyramid/tests/test_magcreator/ref_ellipse_z.npy rename to tests/test_magcreator/ref_ellipse_z.npy diff --git a/pyramid/tests/test_magcreator/ref_ellipsoid.npy b/tests/test_magcreator/ref_ellipsoid.npy similarity index 100% rename from pyramid/tests/test_magcreator/ref_ellipsoid.npy rename to tests/test_magcreator/ref_ellipsoid.npy diff --git a/pyramid/tests/test_magcreator/ref_fil_x.npy b/tests/test_magcreator/ref_fil_x.npy similarity index 100% rename from pyramid/tests/test_magcreator/ref_fil_x.npy rename to tests/test_magcreator/ref_fil_x.npy diff --git a/pyramid/tests/test_magcreator/ref_fil_y.npy b/tests/test_magcreator/ref_fil_y.npy similarity index 100% rename from pyramid/tests/test_magcreator/ref_fil_y.npy rename to tests/test_magcreator/ref_fil_y.npy diff --git a/pyramid/tests/test_magcreator/ref_fil_z.npy b/tests/test_magcreator/ref_fil_z.npy similarity index 100% rename from pyramid/tests/test_magcreator/ref_fil_z.npy rename to tests/test_magcreator/ref_fil_z.npy diff --git a/pyramid/tests/test_magcreator/ref_mag_disc.npy b/tests/test_magcreator/ref_mag_disc.npy similarity index 100% rename from pyramid/tests/test_magcreator/ref_mag_disc.npy rename to tests/test_magcreator/ref_mag_disc.npy diff --git a/pyramid/tests/test_magcreator/ref_mag_vort.npy b/tests/test_magcreator/ref_mag_vort.npy similarity index 100% rename from pyramid/tests/test_magcreator/ref_mag_vort.npy rename to tests/test_magcreator/ref_mag_vort.npy diff --git a/pyramid/tests/test_magcreator/ref_pixel.npy b/tests/test_magcreator/ref_pixel.npy similarity index 100% rename from pyramid/tests/test_magcreator/ref_pixel.npy rename to tests/test_magcreator/ref_pixel.npy diff --git a/pyramid/tests/test_magcreator/ref_slab.npy b/tests/test_magcreator/ref_slab.npy similarity index 100% rename from pyramid/tests/test_magcreator/ref_slab.npy rename to tests/test_magcreator/ref_slab.npy diff --git a/pyramid/tests/test_magcreator/ref_sphere.npy b/tests/test_magcreator/ref_sphere.npy similarity index 100% rename from pyramid/tests/test_magcreator/ref_sphere.npy rename to tests/test_magcreator/ref_sphere.npy diff --git a/pyramid/tests/test_phasemap.py b/tests/test_phasemap.py similarity index 100% rename from pyramid/tests/test_phasemap.py rename to tests/test_phasemap.py diff --git a/pyramid/tests/test_phasemap/ref_phasemap.hdf5 b/tests/test_phasemap/ref_phasemap.hdf5 similarity index 100% rename from pyramid/tests/test_phasemap/ref_phasemap.hdf5 rename to tests/test_phasemap/ref_phasemap.hdf5 diff --git a/pyramid/tests/test_phasemap/ref_phasemap.txt b/tests/test_phasemap/ref_phasemap.txt similarity index 100% rename from pyramid/tests/test_phasemap/ref_phasemap.txt rename to tests/test_phasemap/ref_phasemap.txt diff --git a/pyramid/tests/test_phasemapper.py b/tests/test_phasemapper.py similarity index 100% rename from pyramid/tests/test_phasemapper.py rename to tests/test_phasemapper.py diff --git a/pyramid/tests/test_phasemapper/charge_phase_ref.hdf5 b/tests/test_phasemapper/charge_phase_ref.hdf5 similarity index 100% rename from pyramid/tests/test_phasemapper/charge_phase_ref.hdf5 rename to tests/test_phasemapper/charge_phase_ref.hdf5 diff --git a/pyramid/tests/test_phasemapper/charge_proj.hdf5 b/tests/test_phasemapper/charge_proj.hdf5 similarity index 100% rename from pyramid/tests/test_phasemapper/charge_proj.hdf5 rename to tests/test_phasemapper/charge_proj.hdf5 diff --git a/pyramid/tests/test_phasemapper/elec_proj.hdf5 b/tests/test_phasemapper/elec_proj.hdf5 similarity index 100% rename from pyramid/tests/test_phasemapper/elec_proj.hdf5 rename to tests/test_phasemapper/elec_proj.hdf5 diff --git a/pyramid/tests/test_phasemapper/jac.npy b/tests/test_phasemapper/jac.npy similarity index 100% rename from pyramid/tests/test_phasemapper/jac.npy rename to tests/test_phasemapper/jac.npy diff --git a/pyramid/tests/test_phasemapper/jac_fc.npy b/tests/test_phasemapper/jac_fc.npy similarity index 100% rename from pyramid/tests/test_phasemapper/jac_fc.npy rename to tests/test_phasemapper/jac_fc.npy diff --git a/pyramid/tests/test_phasemapper/jac_fc_pad1.npy b/tests/test_phasemapper/jac_fc_pad1.npy similarity index 100% rename from pyramid/tests/test_phasemapper/jac_fc_pad1.npy rename to tests/test_phasemapper/jac_fc_pad1.npy diff --git a/pyramid/tests/test_phasemapper/jac_fc_pad10.npy b/tests/test_phasemapper/jac_fc_pad10.npy similarity index 100% rename from pyramid/tests/test_phasemapper/jac_fc_pad10.npy rename to tests/test_phasemapper/jac_fc_pad10.npy diff --git a/pyramid/tests/test_phasemapper/mag_proj.hdf5 b/tests/test_phasemapper/mag_proj.hdf5 similarity index 100% rename from pyramid/tests/test_phasemapper/mag_proj.hdf5 rename to tests/test_phasemapper/mag_proj.hdf5 diff --git a/pyramid/tests/test_phasemapper/phasemap.hdf5 b/tests/test_phasemapper/phasemap.hdf5 similarity index 100% rename from pyramid/tests/test_phasemapper/phasemap.hdf5 rename to tests/test_phasemapper/phasemap.hdf5 diff --git a/pyramid/tests/test_phasemapper/phasemap_elec.hdf5 b/tests/test_phasemapper/phasemap_elec.hdf5 similarity index 100% rename from pyramid/tests/test_phasemapper/phasemap_elec.hdf5 rename to tests/test_phasemapper/phasemap_elec.hdf5 diff --git a/pyramid/tests/test_phasemapper/phasemap_fc.hdf5 b/tests/test_phasemapper/phasemap_fc.hdf5 similarity index 100% rename from pyramid/tests/test_phasemapper/phasemap_fc.hdf5 rename to tests/test_phasemapper/phasemap_fc.hdf5 diff --git a/pyramid/tests/test_phasemapper/phasemap_fc_pad1.hdf5 b/tests/test_phasemapper/phasemap_fc_pad1.hdf5 similarity index 100% rename from pyramid/tests/test_phasemapper/phasemap_fc_pad1.hdf5 rename to tests/test_phasemapper/phasemap_fc_pad1.hdf5 diff --git a/pyramid/tests/test_phasemapper/phasemap_fc_pad10.hdf5 b/tests/test_phasemapper/phasemap_fc_pad10.hdf5 similarity index 100% rename from pyramid/tests/test_phasemapper/phasemap_fc_pad10.hdf5 rename to tests/test_phasemapper/phasemap_fc_pad10.hdf5 diff --git a/pyramid/tests/test_pm.py b/tests/test_pm.py similarity index 100% rename from pyramid/tests/test_pm.py rename to tests/test_pm.py diff --git a/pyramid/tests/test_projector.py b/tests/test_projector.py similarity index 100% rename from pyramid/tests/test_projector.py rename to tests/test_projector.py diff --git a/pyramid/tests/test_projector/jac_x.npy b/tests/test_projector/jac_x.npy similarity index 100% rename from pyramid/tests/test_projector/jac_x.npy rename to tests/test_projector/jac_x.npy diff --git a/pyramid/tests/test_projector/jac_x00.npy b/tests/test_projector/jac_x00.npy similarity index 100% rename from pyramid/tests/test_projector/jac_x00.npy rename to tests/test_projector/jac_x00.npy diff --git a/pyramid/tests/test_projector/jac_x45.npy b/tests/test_projector/jac_x45.npy similarity index 100% rename from pyramid/tests/test_projector/jac_x45.npy rename to tests/test_projector/jac_x45.npy diff --git a/pyramid/tests/test_projector/jac_x90.npy b/tests/test_projector/jac_x90.npy similarity index 100% rename from pyramid/tests/test_projector/jac_x90.npy rename to tests/test_projector/jac_x90.npy diff --git a/pyramid/tests/test_projector/jac_y.npy b/tests/test_projector/jac_y.npy similarity index 100% rename from pyramid/tests/test_projector/jac_y.npy rename to tests/test_projector/jac_y.npy diff --git a/pyramid/tests/test_projector/jac_y00.npy b/tests/test_projector/jac_y00.npy similarity index 100% rename from pyramid/tests/test_projector/jac_y00.npy rename to tests/test_projector/jac_y00.npy diff --git a/pyramid/tests/test_projector/jac_y45.npy b/tests/test_projector/jac_y45.npy similarity index 100% rename from pyramid/tests/test_projector/jac_y45.npy rename to tests/test_projector/jac_y45.npy diff --git a/pyramid/tests/test_projector/jac_y90.npy b/tests/test_projector/jac_y90.npy similarity index 100% rename from pyramid/tests/test_projector/jac_y90.npy rename to tests/test_projector/jac_y90.npy diff --git a/pyramid/tests/test_projector/jac_z.npy b/tests/test_projector/jac_z.npy similarity index 100% rename from pyramid/tests/test_projector/jac_z.npy rename to tests/test_projector/jac_z.npy diff --git a/pyramid/tests/test_projector/ref_mag_proj_x.hdf5 b/tests/test_projector/ref_mag_proj_x.hdf5 similarity index 100% rename from pyramid/tests/test_projector/ref_mag_proj_x.hdf5 rename to tests/test_projector/ref_mag_proj_x.hdf5 diff --git a/pyramid/tests/test_projector/ref_mag_proj_x00.hdf5 b/tests/test_projector/ref_mag_proj_x00.hdf5 similarity index 100% rename from pyramid/tests/test_projector/ref_mag_proj_x00.hdf5 rename to tests/test_projector/ref_mag_proj_x00.hdf5 diff --git a/pyramid/tests/test_projector/ref_mag_proj_x45.hdf5 b/tests/test_projector/ref_mag_proj_x45.hdf5 similarity index 100% rename from pyramid/tests/test_projector/ref_mag_proj_x45.hdf5 rename to tests/test_projector/ref_mag_proj_x45.hdf5 diff --git a/pyramid/tests/test_projector/ref_mag_proj_x90.hdf5 b/tests/test_projector/ref_mag_proj_x90.hdf5 similarity index 100% rename from pyramid/tests/test_projector/ref_mag_proj_x90.hdf5 rename to tests/test_projector/ref_mag_proj_x90.hdf5 diff --git a/pyramid/tests/test_projector/ref_mag_proj_y.hdf5 b/tests/test_projector/ref_mag_proj_y.hdf5 similarity index 100% rename from pyramid/tests/test_projector/ref_mag_proj_y.hdf5 rename to tests/test_projector/ref_mag_proj_y.hdf5 diff --git a/pyramid/tests/test_projector/ref_mag_proj_y00.hdf5 b/tests/test_projector/ref_mag_proj_y00.hdf5 similarity index 100% rename from pyramid/tests/test_projector/ref_mag_proj_y00.hdf5 rename to tests/test_projector/ref_mag_proj_y00.hdf5 diff --git a/pyramid/tests/test_projector/ref_mag_proj_y45.hdf5 b/tests/test_projector/ref_mag_proj_y45.hdf5 similarity index 100% rename from pyramid/tests/test_projector/ref_mag_proj_y45.hdf5 rename to tests/test_projector/ref_mag_proj_y45.hdf5 diff --git a/pyramid/tests/test_projector/ref_mag_proj_y90.hdf5 b/tests/test_projector/ref_mag_proj_y90.hdf5 similarity index 100% rename from pyramid/tests/test_projector/ref_mag_proj_y90.hdf5 rename to tests/test_projector/ref_mag_proj_y90.hdf5 diff --git a/pyramid/tests/test_projector/ref_mag_proj_z.hdf5 b/tests/test_projector/ref_mag_proj_z.hdf5 similarity index 100% rename from pyramid/tests/test_projector/ref_mag_proj_z.hdf5 rename to tests/test_projector/ref_mag_proj_z.hdf5 diff --git a/pyramid/tests/test_projector/ref_magdata.hdf5 b/tests/test_projector/ref_magdata.hdf5 similarity index 100% rename from pyramid/tests/test_projector/ref_magdata.hdf5 rename to tests/test_projector/ref_magdata.hdf5 diff --git a/pyramid/tests/test_regularisator.py b/tests/test_regularisator.py similarity index 100% rename from pyramid/tests/test_regularisator.py rename to tests/test_regularisator.py diff --git a/pyramid/tests/test_regularisator/first_order_cost_ref.npy b/tests/test_regularisator/first_order_cost_ref.npy similarity index 100% rename from pyramid/tests/test_regularisator/first_order_cost_ref.npy rename to tests/test_regularisator/first_order_cost_ref.npy diff --git a/pyramid/tests/test_regularisator/first_order_jac_ref.npy b/tests/test_regularisator/first_order_jac_ref.npy similarity index 100% rename from pyramid/tests/test_regularisator/first_order_jac_ref.npy rename to tests/test_regularisator/first_order_jac_ref.npy diff --git a/pyramid/tests/test_regularisator/first_order_jac_vec_ref.npy b/tests/test_regularisator/first_order_jac_vec_ref.npy similarity index 100% rename from pyramid/tests/test_regularisator/first_order_jac_vec_ref.npy rename to tests/test_regularisator/first_order_jac_vec_ref.npy