From dd9bfcb89101caf9a4f211bb9d05ed361eb00e9b Mon Sep 17 00:00:00 2001 From: Aaron David Schneider Date: Tue, 24 Oct 2023 11:54:45 +0200 Subject: [PATCH 01/10] next try --- ci/environment-3.10.yml | 5 +++-- ci/environment-3.8.yml | 5 +++-- ci/environment-3.9.yml | 5 +++-- ci/environment-xarraymaster.yml | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ci/environment-3.10.yml b/ci/environment-3.10.yml index 0abbf14..e443831 100644 --- a/ci/environment-3.10.yml +++ b/ci/environment-3.10.yml @@ -9,8 +9,9 @@ dependencies: - pytest-cov - xarray - h5py - - numpy=1.21.5 - - setuptools=61.2.0 + - numpy + - scipy + - setuptools - netcdf4 - pip - pip: diff --git a/ci/environment-3.8.yml b/ci/environment-3.8.yml index f4bb765..49f37f4 100644 --- a/ci/environment-3.8.yml +++ b/ci/environment-3.8.yml @@ -9,8 +9,9 @@ dependencies: - pytest-cov - xarray - h5py - - numpy=1.21.5 - - setuptools=61.2.0 + - numpy + - scipy + - setuptools - netcdf4 - pip - pip: diff --git a/ci/environment-3.9.yml b/ci/environment-3.9.yml index 1fc4fc2..5ce9400 100644 --- a/ci/environment-3.9.yml +++ b/ci/environment-3.9.yml @@ -9,8 +9,9 @@ dependencies: - pytest-cov - xarray - h5py - - numpy=1.21.5 - - setuptools=61.2.0 + - numpy + - scipy + - setuptools - netcdf4 - pip - pip: diff --git a/ci/environment-xarraymaster.yml b/ci/environment-xarraymaster.yml index c151dbc..8d5e5ca 100644 --- a/ci/environment-xarraymaster.yml +++ b/ci/environment-xarraymaster.yml @@ -8,8 +8,9 @@ dependencies: - codecov - pytest-cov - h5py - - numpy=1.21.5 - - setuptools=61.2.0 + - numpy + - scipy + - setuptools - netcdf4 - pip - pip: From 6ab7bbee10e0e12c09a601a5e7f677ccf1203542 Mon Sep 17 00:00:00 2001 From: Aaron David Schneider Date: Wed, 25 Oct 2023 10:51:49 +0200 Subject: [PATCH 02/10] next try --- ci/environment-3.10.yml | 7 ++++++- ci/environment-3.8.yml | 6 +++++- ci/environment-3.9.yml | 6 +++++- ci/environment-xarraymaster.yml | 7 ++++++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/ci/environment-3.10.yml b/ci/environment-3.10.yml index e443831..bd6f042 100644 --- a/ci/environment-3.10.yml +++ b/ci/environment-3.10.yml @@ -3,16 +3,21 @@ channels: - conda-forge dependencies: - python=3.10 + - xarray - cubedsphere - pytest - codecov - pytest-cov - - xarray - h5py + - matplotlib + - astropy - numpy - scipy - setuptools - netcdf4 + - pandas>2.0.3 + - numba>=0.58.0 + - llvmlite>=0.41.0 - pip - pip: - git+https://github.com/MITgcm/xmitgcm.git diff --git a/ci/environment-3.8.yml b/ci/environment-3.8.yml index 49f37f4..49a4d39 100644 --- a/ci/environment-3.8.yml +++ b/ci/environment-3.8.yml @@ -7,12 +7,16 @@ dependencies: - pytest - codecov - pytest-cov - - xarray - h5py + - matplotlib + - astropy - numpy - scipy - setuptools - netcdf4 + - pandas>2.0.3 + - numba>=0.58.0 + - llvmlite>=0.41.0 - pip - pip: - git+https://github.com/MITgcm/xmitgcm.git diff --git a/ci/environment-3.9.yml b/ci/environment-3.9.yml index 5ce9400..5c2478f 100644 --- a/ci/environment-3.9.yml +++ b/ci/environment-3.9.yml @@ -7,12 +7,16 @@ dependencies: - pytest - codecov - pytest-cov - - xarray - h5py + - matplotlib + - astropy - numpy - scipy - setuptools - netcdf4 + - pandas>2.0.3 + - numba>=0.58.0 + - llvmlite>=0.41.0 - pip - pip: - git+https://github.com/MITgcm/xmitgcm.git diff --git a/ci/environment-xarraymaster.yml b/ci/environment-xarraymaster.yml index 8d5e5ca..018e66e 100644 --- a/ci/environment-xarraymaster.yml +++ b/ci/environment-xarraymaster.yml @@ -8,14 +8,19 @@ dependencies: - codecov - pytest-cov - h5py + - matplotlib + - astropy - numpy - scipy - setuptools - netcdf4 + - pandas>2.0.3 + - numba>=0.58.0 + - llvmlite>=0.41.0 - pip - pip: - git+https://github.com/MITgcm/xmitgcm.git - git+https://github.com/pydata/xarray.git - miepython - petitRADTRANS==2.4.9 - - prt-phasecurve + - prt-phasecurve \ No newline at end of file From 2e47c339d0b6ce6d41a8482c55ca02bbec8f1540 Mon Sep 17 00:00:00 2001 From: Aaron David Schneider Date: Wed, 25 Oct 2023 11:18:22 +0200 Subject: [PATCH 03/10] update to mambaforge --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cc2baf..a5636bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,9 @@ jobs: - uses: conda-incubator/setup-miniconda@v2 with: activate-environment: test_env # Defined in ci/environment*.yml - auto-update-conda: false + miniforge-variant: Mambaforge + miniforge-version: latest + use-mamba: true python-version: ${{ matrix.python-version }} environment-file: ci/environment-${{ matrix.python-version }}.yml use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! From 1094d73956ef1c172d40ee572ef96c3919142987 Mon Sep 17 00:00:00 2001 From: Aaron David Schneider Date: Wed, 25 Oct 2023 11:31:43 +0200 Subject: [PATCH 04/10] extra pip install --- .github/workflows/ci.yml | 4 +++- ci/environment-3.10.yml | 6 ------ ci/environment-3.8.yml | 25 ------------------------- ci/environment-3.9.yml | 8 +------- ci/environment-xarraymaster.yml | 4 ---- 5 files changed, 4 insertions(+), 43 deletions(-) delete mode 100644 ci/environment-3.8.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5636bb..dbb1c1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false matrix: os: [ "ubuntu-latest" ] - python-version: [ "3.8", "3.9", "3.10" ] + python-version: [ "3.9", "3.10" ] steps: - uses: actions/checkout@v2 - name: Cache conda @@ -43,6 +43,7 @@ jobs: - name: Set up conda environment shell: bash -l {0} run: | + python -m pip install git+https://github.com/MITgcm/xmitgcm.git miepython petitRADTRANS==2.4.9 prt-phasecurve python -m pip install -e . conda list - name: Run Tests @@ -77,6 +78,7 @@ jobs: - name: Set up conda environment shell: bash -l {0} run: | + python -m pip install git+https://github.com/MITgcm/xmitgcm.git miepython petitRADTRANS==2.4.9 prt-phasecurve python -m pip install -e . conda list - name: Run Tests diff --git a/ci/environment-3.10.yml b/ci/environment-3.10.yml index bd6f042..ee4ca59 100644 --- a/ci/environment-3.10.yml +++ b/ci/environment-3.10.yml @@ -18,9 +18,3 @@ dependencies: - pandas>2.0.3 - numba>=0.58.0 - llvmlite>=0.41.0 - - pip - - pip: - - git+https://github.com/MITgcm/xmitgcm.git - - miepython - - petitRADTRANS==2.4.9 - - prt-phasecurve diff --git a/ci/environment-3.8.yml b/ci/environment-3.8.yml deleted file mode 100644 index 49a4d39..0000000 --- a/ci/environment-3.8.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: test_env -channels: - - conda-forge -dependencies: - - python=3.8 - - cubedsphere - - pytest - - codecov - - pytest-cov - - h5py - - matplotlib - - astropy - - numpy - - scipy - - setuptools - - netcdf4 - - pandas>2.0.3 - - numba>=0.58.0 - - llvmlite>=0.41.0 - - pip - - pip: - - git+https://github.com/MITgcm/xmitgcm.git - - miepython - - petitRADTRANS==2.4.9 - - prt-phasecurve diff --git a/ci/environment-3.9.yml b/ci/environment-3.9.yml index 5c2478f..e31759a 100644 --- a/ci/environment-3.9.yml +++ b/ci/environment-3.9.yml @@ -17,10 +17,4 @@ dependencies: - pandas>2.0.3 - numba>=0.58.0 - llvmlite>=0.41.0 - - pip - - pip: - - git+https://github.com/MITgcm/xmitgcm.git - - miepython - - petitRADTRANS==2.4.9 - - prt-phasecurve - + - pip \ No newline at end of file diff --git a/ci/environment-xarraymaster.yml b/ci/environment-xarraymaster.yml index 018e66e..0e95c91 100644 --- a/ci/environment-xarraymaster.yml +++ b/ci/environment-xarraymaster.yml @@ -19,8 +19,4 @@ dependencies: - llvmlite>=0.41.0 - pip - pip: - - git+https://github.com/MITgcm/xmitgcm.git - git+https://github.com/pydata/xarray.git - - miepython - - petitRADTRANS==2.4.9 - - prt-phasecurve \ No newline at end of file From f51d351de699142a66d2cf7b502222d991ff5eeb Mon Sep 17 00:00:00 2001 From: Aaron David Schneider Date: Wed, 25 Oct 2023 11:39:42 +0200 Subject: [PATCH 05/10] upgrade only if needed --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbb1c1b..0ed296a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,7 +78,7 @@ jobs: - name: Set up conda environment shell: bash -l {0} run: | - python -m pip install git+https://github.com/MITgcm/xmitgcm.git miepython petitRADTRANS==2.4.9 prt-phasecurve + python -m pip install --upgrade --upgrade-strategy only-if-needed git+https://github.com/MITgcm/xmitgcm.git miepython petitRADTRANS==2.4.9 prt-phasecurve python -m pip install -e . conda list - name: Run Tests From 47c5c9979f7848d32333c696e9ea39bb0d8de11b Mon Sep 17 00:00:00 2001 From: Aaron David Schneider Date: Wed, 25 Oct 2023 11:46:47 +0200 Subject: [PATCH 06/10] remove hdf5 again --- ci/environment-3.10.yml | 1 - ci/environment-3.9.yml | 1 - ci/environment-xarraymaster.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/ci/environment-3.10.yml b/ci/environment-3.10.yml index ee4ca59..6019946 100644 --- a/ci/environment-3.10.yml +++ b/ci/environment-3.10.yml @@ -8,7 +8,6 @@ dependencies: - pytest - codecov - pytest-cov - - h5py - matplotlib - astropy - numpy diff --git a/ci/environment-3.9.yml b/ci/environment-3.9.yml index e31759a..0975495 100644 --- a/ci/environment-3.9.yml +++ b/ci/environment-3.9.yml @@ -7,7 +7,6 @@ dependencies: - pytest - codecov - pytest-cov - - h5py - matplotlib - astropy - numpy diff --git a/ci/environment-xarraymaster.yml b/ci/environment-xarraymaster.yml index 0e95c91..f3c0496 100644 --- a/ci/environment-xarraymaster.yml +++ b/ci/environment-xarraymaster.yml @@ -7,7 +7,6 @@ dependencies: - pytest - codecov - pytest-cov - - h5py - matplotlib - astropy - numpy From b34fcedc1887ee5ab876a157f48ff06ccad041b4 Mon Sep 17 00:00:00 2001 From: Aaron David Schneider Date: Wed, 25 Oct 2023 15:50:19 +0200 Subject: [PATCH 07/10] go all in with conda --- .github/workflows/ci.yml | 4 ++-- ci/environment-3.10.yml | 19 +++++++++++++++++-- ci/environment-3.9.yml | 17 ++++++++++++++++- ci/environment-xarraymaster.yml | 17 ++++++++++++++++- 4 files changed, 51 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ed296a..279dd77 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: - name: Set up conda environment shell: bash -l {0} run: | - python -m pip install git+https://github.com/MITgcm/xmitgcm.git miepython petitRADTRANS==2.4.9 prt-phasecurve + python -m pip install --no-deps git+https://github.com/MITgcm/xmitgcm.git petitRADTRANS==2.4.9 prt-phasecurve python -m pip install -e . conda list - name: Run Tests @@ -78,7 +78,7 @@ jobs: - name: Set up conda environment shell: bash -l {0} run: | - python -m pip install --upgrade --upgrade-strategy only-if-needed git+https://github.com/MITgcm/xmitgcm.git miepython petitRADTRANS==2.4.9 prt-phasecurve + python -m pip install --no-deps git+https://github.com/MITgcm/xmitgcm.git petitRADTRANS==2.4.9 prt-phasecurve python -m pip install -e . conda list - name: Run Tests diff --git a/ci/environment-3.10.yml b/ci/environment-3.10.yml index 6019946..ca77ecb 100644 --- a/ci/environment-3.10.yml +++ b/ci/environment-3.10.yml @@ -3,17 +3,32 @@ channels: - conda-forge dependencies: - python=3.10 - - xarray - cubedsphere - pytest - codecov - pytest-cov - matplotlib - astropy - - numpy + - numpy==1.24.4 - scipy - setuptools - netcdf4 - pandas>2.0.3 - numba>=0.58.0 - llvmlite>=0.41.0 + - corner + - tqdm + - dask + - cfgv + - distlib + - filelock + - h5py + - miepython + - molmass + - platformdirs + - nodeenv + - pre-commit + - pymultinest + - pyqt5-sip + - seaborn + - pip diff --git a/ci/environment-3.9.yml b/ci/environment-3.9.yml index 0975495..320c2ce 100644 --- a/ci/environment-3.9.yml +++ b/ci/environment-3.9.yml @@ -9,11 +9,26 @@ dependencies: - pytest-cov - matplotlib - astropy - - numpy + - numpy==1.24.4 - scipy - setuptools - netcdf4 - pandas>2.0.3 - numba>=0.58.0 - llvmlite>=0.41.0 + - corner + - tqdm + - dask + - cfgv + - distlib + - filelock + - h5py + - miepython + - molmass + - platformdirs + - nodeenv + - pre-commit + - pymultinest + - pyqt5-sip + - seaborn - pip \ No newline at end of file diff --git a/ci/environment-xarraymaster.yml b/ci/environment-xarraymaster.yml index f3c0496..3f99728 100644 --- a/ci/environment-xarraymaster.yml +++ b/ci/environment-xarraymaster.yml @@ -9,13 +9,28 @@ dependencies: - pytest-cov - matplotlib - astropy - - numpy + - numpy==1.24.4 - scipy - setuptools - netcdf4 - pandas>2.0.3 - numba>=0.58.0 - llvmlite>=0.41.0 + - corner + - tqdm + - dask + - cfgv + - distlib + - filelock + - h5py + - miepython + - molmass + - platformdirs + - nodeenv + - pre-commit + - pymultinest + - pyqt5-sip + - seaborn - pip - pip: - git+https://github.com/pydata/xarray.git From 5fde57c9579debaa573ceb7e0c69b40d21e290dd Mon Sep 17 00:00:00 2001 From: Aaron David Schneider Date: Wed, 25 Oct 2023 15:55:21 +0200 Subject: [PATCH 08/10] not all available --- .github/workflows/ci.yml | 4 ++-- ci/environment-3.10.yml | 4 +--- ci/environment-3.9.yml | 4 +--- ci/environment-xarraymaster.yml | 4 +--- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 279dd77..696c9df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: - name: Set up conda environment shell: bash -l {0} run: | - python -m pip install --no-deps git+https://github.com/MITgcm/xmitgcm.git petitRADTRANS==2.4.9 prt-phasecurve + python -m pip install --no-deps molmass miepython git+https://github.com/MITgcm/xmitgcm.git petitRADTRANS==2.4.9 prt-phasecurve python -m pip install -e . conda list - name: Run Tests @@ -78,7 +78,7 @@ jobs: - name: Set up conda environment shell: bash -l {0} run: | - python -m pip install --no-deps git+https://github.com/MITgcm/xmitgcm.git petitRADTRANS==2.4.9 prt-phasecurve + python -m pip install --no-deps molmass miepython git+https://github.com/MITgcm/xmitgcm.git petitRADTRANS==2.4.9 prt-phasecurve python -m pip install -e . conda list - name: Run Tests diff --git a/ci/environment-3.10.yml b/ci/environment-3.10.yml index ca77ecb..ba039e1 100644 --- a/ci/environment-3.10.yml +++ b/ci/environment-3.10.yml @@ -9,7 +9,7 @@ dependencies: - pytest-cov - matplotlib - astropy - - numpy==1.24.4 + - numpy - scipy - setuptools - netcdf4 @@ -23,8 +23,6 @@ dependencies: - distlib - filelock - h5py - - miepython - - molmass - platformdirs - nodeenv - pre-commit diff --git a/ci/environment-3.9.yml b/ci/environment-3.9.yml index 320c2ce..23cbe8b 100644 --- a/ci/environment-3.9.yml +++ b/ci/environment-3.9.yml @@ -9,7 +9,7 @@ dependencies: - pytest-cov - matplotlib - astropy - - numpy==1.24.4 + - numpy - scipy - setuptools - netcdf4 @@ -23,8 +23,6 @@ dependencies: - distlib - filelock - h5py - - miepython - - molmass - platformdirs - nodeenv - pre-commit diff --git a/ci/environment-xarraymaster.yml b/ci/environment-xarraymaster.yml index 3f99728..8218e78 100644 --- a/ci/environment-xarraymaster.yml +++ b/ci/environment-xarraymaster.yml @@ -9,7 +9,7 @@ dependencies: - pytest-cov - matplotlib - astropy - - numpy==1.24.4 + - numpy - scipy - setuptools - netcdf4 @@ -23,8 +23,6 @@ dependencies: - distlib - filelock - h5py - - miepython - - molmass - platformdirs - nodeenv - pre-commit From d356923cf535a4a8a16f9bafca00f691f22c0540 Mon Sep 17 00:00:00 2001 From: Aaron David Schneider Date: Thu, 26 Oct 2023 15:28:58 +0200 Subject: [PATCH 09/10] less requirements --- ci/environment-3.10.yml | 13 +++---------- ci/environment-3.9.yml | 13 +++---------- ci/environment-xarraymaster.yml | 13 +++---------- 3 files changed, 9 insertions(+), 30 deletions(-) diff --git a/ci/environment-3.10.yml b/ci/environment-3.10.yml index ba039e1..f331c9c 100644 --- a/ci/environment-3.10.yml +++ b/ci/environment-3.10.yml @@ -6,6 +6,7 @@ dependencies: - cubedsphere - pytest - codecov + - xmitgcm - pytest-cov - matplotlib - astropy @@ -13,20 +14,12 @@ dependencies: - scipy - setuptools - netcdf4 - - pandas>2.0.3 - - numba>=0.58.0 - - llvmlite>=0.41.0 + - pandas + - numba - corner - tqdm - - dask - - cfgv - - distlib - - filelock - h5py - - platformdirs - - nodeenv - pre-commit - pymultinest - - pyqt5-sip - seaborn - pip diff --git a/ci/environment-3.9.yml b/ci/environment-3.9.yml index 23cbe8b..bd66780 100644 --- a/ci/environment-3.9.yml +++ b/ci/environment-3.9.yml @@ -6,6 +6,7 @@ dependencies: - cubedsphere - pytest - codecov + - xmitgcm - pytest-cov - matplotlib - astropy @@ -13,20 +14,12 @@ dependencies: - scipy - setuptools - netcdf4 - - pandas>2.0.3 - - numba>=0.58.0 - - llvmlite>=0.41.0 + - pandas + - numba - corner - tqdm - - dask - - cfgv - - distlib - - filelock - h5py - - platformdirs - - nodeenv - pre-commit - pymultinest - - pyqt5-sip - seaborn - pip \ No newline at end of file diff --git a/ci/environment-xarraymaster.yml b/ci/environment-xarraymaster.yml index 8218e78..82adefa 100644 --- a/ci/environment-xarraymaster.yml +++ b/ci/environment-xarraymaster.yml @@ -6,6 +6,7 @@ dependencies: - cubedsphere - pytest - codecov + - xmitgcm - pytest-cov - matplotlib - astropy @@ -13,21 +14,13 @@ dependencies: - scipy - setuptools - netcdf4 - - pandas>2.0.3 - - numba>=0.58.0 - - llvmlite>=0.41.0 + - pandas + - numba - corner - tqdm - - dask - - cfgv - - distlib - - filelock - h5py - - platformdirs - - nodeenv - pre-commit - pymultinest - - pyqt5-sip - seaborn - pip - pip: From 3f8210f5ea61b82185373c8b3012638162d2c057 Mon Sep 17 00:00:00 2001 From: Aaron David Schneider Date: Thu, 26 Oct 2023 15:54:37 +0200 Subject: [PATCH 10/10] use Z instead of Z_l --- gcm_toolkit/tests/test_interface.py | 44 ++++++++++++++++++----------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/gcm_toolkit/tests/test_interface.py b/gcm_toolkit/tests/test_interface.py index 23cc3f7..fb4c040 100644 --- a/gcm_toolkit/tests/test_interface.py +++ b/gcm_toolkit/tests/test_interface.py @@ -43,15 +43,21 @@ def test_prt_interface(petitradtrans_testdata, all_raw_testdata): ) # add cloud properties - dsi_clouds = tools.get_models('0') - tmp = np.ones((len(dsi_clouds['time']), len(dsi_clouds['lat']), - len(dsi_clouds['lon']), len(dsi_clouds['Z_l']))) - dsi_clouds['ClAb'] = (('time', 'lat', 'lon', 'Z_l'), tmp*1e-5) - dsi_clouds['ClDs'] = (('time', 'lat', 'lon', 'Z_l'), tmp*1e2) - dsi_clouds['ClDr'] = (('time', 'lat', 'lon', 'Z_l'), tmp*1e3) - dsi_clouds['ClVf_Test1[s]'] = (('time', 'lat', 'lon', 'Z_l'), tmp*0.5) - dsi_clouds['ClVf_Test2[s]'] = (('time', 'lat', 'lon', 'Z_l'), tmp*0.5) - tools._replace_model('0', dsi_clouds) + dsi_clouds = tools.get_models("0") + tmp = np.ones( + ( + len(dsi_clouds["time"]), + len(dsi_clouds["lat"]), + len(dsi_clouds["lon"]), + len(dsi_clouds["Z"]), + ) + ) + dsi_clouds["ClAb"] = (("time", "lat", "lon", "Z"), tmp * 1e-5) + dsi_clouds["ClDs"] = (("time", "lat", "lon", "Z"), tmp * 1e2) + dsi_clouds["ClDr"] = (("time", "lat", "lon", "Z"), tmp * 1e3) + dsi_clouds["ClVf_Test1[s]"] = (("time", "lat", "lon", "Z"), tmp * 0.5) + dsi_clouds["ClVf_Test2[s]"] = (("time", "lat", "lon", "Z"), tmp * 0.5) + tools._replace_model("0", dsi_clouds) phases = np.linspace(0, 1, 50) interface = tools.get_prt_interface(pRT) @@ -113,9 +119,11 @@ def test_prt_interface(petitradtrans_testdata, all_raw_testdata): ) # test transit calculation set up - interface.set_data(time=expected["times"][-1], terminator_avg=True, lon_resolution=60) - assert (interface.dsi['lon'].values == [-90, 90]).all() - assert interface.dsi['lat'].values == [0] + interface.set_data( + time=expected["times"][-1], terminator_avg=True, lon_resolution=60 + ) + assert (interface.dsi["lon"].values == [-90, 90]).all() + assert interface.dsi["lat"].values == [0] # test transit calculation interface.chem_from_poorman("T", co_ratio=0.55, feh_ratio=0.0) @@ -129,7 +137,9 @@ def test_prt_interface(petitradtrans_testdata, all_raw_testdata): # test transit calculation interface.chem_from_poorman("T", co_ratio=0.55, feh_ratio=0.0) - wave, spectra = interface.calc_transit_spectrum(mmw=2.33, clouds=True, use_bruggemann=True) + wave, spectra = interface.calc_transit_spectrum( + mmw=2.33, clouds=True, use_bruggemann=True + ) assert sum(spectra) == 45237213620.53514 # Test if Pa works @@ -253,7 +263,7 @@ def test_PAC_interface(all_nc_testdata): pac2d.set_data(time=expected["times"][-1]) with pytest.raises(OSError): - pac1d.write_inputfile('non/existent/path') - pac2d.write_inputfile('non/existent/path') - pac2d.generate_lptfile('non/existent/path') - pac2d.generate_aptfiles('non/existent/path') + pac1d.write_inputfile("non/existent/path") + pac2d.write_inputfile("non/existent/path") + pac2d.generate_lptfile("non/existent/path") + pac2d.generate_aptfiles("non/existent/path")