From 60059feb07bb534cf8d84e2049f907cc317a86b4 Mon Sep 17 00:00:00 2001 From: Thomas Ceulemans Date: Tue, 31 Mar 2026 09:27:35 +0200 Subject: [PATCH 1/4] Update readthedocs yml (before deprecation of ubuntu 20 image) --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 0ad29e18..fc74024d 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -12,7 +12,7 @@ submodules: # Set the version of Python and other tools you might need build: - os: ubuntu-20.04 + os: ubuntu-24.04 tools: python: "mambaforge-4.10" From 8c13c62be5297bc8ab57f7f870708ee90aa5e4bb Mon Sep 17 00:00:00 2001 From: Thomas Ceulemans Date: Tue, 31 Mar 2026 11:59:42 +0200 Subject: [PATCH 2/4] Changed deprecated numpy trapz to trapezoid --- tests/benchmarks/analytic/continuum_implementation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/benchmarks/analytic/continuum_implementation.py b/tests/benchmarks/analytic/continuum_implementation.py index 8882522e..04d6eec2 100644 --- a/tests/benchmarks/analytic/continuum_implementation.py +++ b/tests/benchmarks/analytic/continuum_implementation.py @@ -134,7 +134,7 @@ def evaluate_dust_opacity(frequency, velocity): #compute optical depth chi_shifted = evaluate_dust_opacity(dust_frequencies, np.array(model.geometry.points.velocity)[:,0]) - tau_ref = np.trapz(chi_shifted, x=np.array(model.geometry.points.position)[:,0], axis=0) + tau_ref = np.trapezoid(chi_shifted, x=np.array(model.geometry.points.position)[:,0], axis=0) #TODO: fix the calculation of the reference intensity; currently it is wrong for any model with non-zero velocity field due to not taking into account the doppler shifts properly #test attempt below # def evaluate_source_function(frequency, velocity): From 67286cda414ee868c86074e3d9ba15bd329af051 Mon Sep 17 00:00:00 2001 From: Thomas Ceulemans Date: Wed, 8 Apr 2026 14:04:09 +0200 Subject: [PATCH 3/4] Moved plons dependency to pip install --- dependencies/conda_env.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dependencies/conda_env.yml b/dependencies/conda_env.yml index 1726520e..03376c6b 100644 --- a/dependencies/conda_env.yml +++ b/dependencies/conda_env.yml @@ -33,8 +33,9 @@ dependencies: - pip: - breathe - sphinx_rtd_theme - ##install both with pip, otherwise it will install the wrong version, not compatible with sphinx + - plons + ##install both breathe and sphinx_rtd_theme with pip, otherwise it will install the wrong version, not compatible with sphinx - sphinx-copybutton - nbsphinx - pytest - - plons #for importing Phantom models + From 1acdbea892c7f06d8d7b0b23898386abd2ed3bfb Mon Sep 17 00:00:00 2001 From: Thomas Ceulemans Date: Wed, 8 Apr 2026 15:16:38 +0200 Subject: [PATCH 4/4] Some plons api has changed in the meantime, so adapting the relevant readin examples (and automated test). --- dependencies/conda_env.yml | 4 ++-- .../1_post-processing/3_create_Phantom_3D.ipynb | 14 ++++++++++---- .../3_create_Phantom_3D_column.ipynb | 14 ++++++++++---- .../benchmarks/numeric/import_phantom_3D_model.py | 12 +++++++++--- 4 files changed, 31 insertions(+), 13 deletions(-) diff --git a/dependencies/conda_env.yml b/dependencies/conda_env.yml index 03376c6b..dbf01f94 100644 --- a/dependencies/conda_env.yml +++ b/dependencies/conda_env.yml @@ -1,4 +1,4 @@ -name: magritte +name: magritte_test_plons channels: - ensor - conda-forge @@ -6,7 +6,7 @@ channels: - defaults # The order of the channels above is critical!!! dependencies: - - python>=3.9 + - python<=3.13 - cmake - numpy - jupyterlab diff --git a/docs/src/1_examples/1_post-processing/3_create_Phantom_3D.ipynb b/docs/src/1_examples/1_post-processing/3_create_Phantom_3D.ipynb index 1a016fda..f85233b2 100644 --- a/docs/src/1_examples/1_post-processing/3_create_Phantom_3D.ipynb +++ b/docs/src/1_examples/1_post-processing/3_create_Phantom_3D.ipynb @@ -170,7 +170,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -178,12 +178,18 @@ "setupData = plons.LoadSetup(wdir, \"wind\")\n", "dumpData = plons.LoadFullDump(dump_file, setupData)\n", "\n", - "position = dumpData[\"position\"]*1e-2 # position vectors [cm -> m]\n", - "velocity = dumpData[\"velocity\"]*1e3 # velocity vectors [km/s -> m/s]\n", + "pos_x = dumpData[\"x\"]*1e-2 # x position vectors [cm -> m]\n", + "pos_y = dumpData[\"y\"]*1e-2 # y position vectors [cm -> m]\n", + "pos_z = dumpData[\"z\"]*1e-2 # z position vectors [cm -> m]\n", + "position = np.array((pos_x, pos_y, pos_z)).T\n", + "vel_x = dumpData[\"vx\"]*1e3 # x velocity vectors [km/s -> m/s]\n", + "vel_y = dumpData[\"vy\"]*1e3 # y velocity vectors [km/s -> m/s]\n", + "vel_z = dumpData[\"vz\"]*1e3 # z velocity vectors [km/s -> m/s]\n", + "velocity = np.array((vel_x, vel_y, vel_z)).T\n", "velocity = velocity/constants.c.si.value # velocity vectors [m/s -> 1/c]\n", "rho = dumpData[\"rho\"] # density [g/cm^3]\n", "u = dumpData[\"u\"] # internal energy density [erg/g]\n", - "tmp = dumpData[\"Tgas\"] # temperature [K]\n", + "tmp = dumpData[\"temp\"] # temperature [K]\n", "tmp[tmp<2.725] = 2.725 # Cut-off temperatures below 2.725 K\n", "\n", "# Extract the number of points\n", diff --git a/docs/src/1_examples/1_post-processing/3_create_Phantom_3D_column.ipynb b/docs/src/1_examples/1_post-processing/3_create_Phantom_3D_column.ipynb index 8b63ef64..6f021fe7 100644 --- a/docs/src/1_examples/1_post-processing/3_create_Phantom_3D_column.ipynb +++ b/docs/src/1_examples/1_post-processing/3_create_Phantom_3D_column.ipynb @@ -182,7 +182,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -190,12 +190,18 @@ "setupData = plons.LoadSetup(wdir, \"wind\")\n", "dumpData = plons.LoadFullDump(dump_file, setupData)\n", "\n", - "position = dumpData[\"position\"]*1e-2 # position vectors [cm -> m]\n", - "velocity = dumpData[\"velocity\"]*1e3 # velocity vectors [km/s -> m/s]\n", + "pos_x = dumpData[\"x\"]*1e-2 # x position vectors [cm -> m]\n", + "pos_y = dumpData[\"y\"]*1e-2 # y position vectors [cm -> m]\n", + "pos_z = dumpData[\"z\"]*1e-2 # z position vectors [cm -> m]\n", + "position = np.array((pos_x, pos_y, pos_z)).T\n", + "vel_x = dumpData[\"vx\"]*1e3 # x velocity vectors [km/s -> m/s]\n", + "vel_y = dumpData[\"vy\"]*1e3 # y velocity vectors [km/s -> m/s]\n", + "vel_z = dumpData[\"vz\"]*1e3 # z velocity vectors [km/s -> m/s]\n", + "velocity = np.array((vel_x, vel_y, vel_z)).T\n", "velocity = velocity/constants.c.si.value # velocity vectors [m/s -> 1/c]\n", "rho = dumpData[\"rho\"] # density [g/cm^3]\n", "u = dumpData[\"u\"] # internal energy density [erg/g]\n", - "tmp = dumpData[\"Tgas\"] # temperature [K]\n", + "tmp = dumpData[\"temp\"] # temperature [K]\n", "tmp[tmp<2.725] = 2.725 # Cut-off temperatures below 2.725 K\n", "\n", "# Extract the number of points\n", diff --git a/tests/benchmarks/numeric/import_phantom_3D_model.py b/tests/benchmarks/numeric/import_phantom_3D_model.py index 6ffa7caf..0ff3e56f 100644 --- a/tests/benchmarks/numeric/import_phantom_3D_model.py +++ b/tests/benchmarks/numeric/import_phantom_3D_model.py @@ -50,12 +50,18 @@ def import_phantom(): setupData = plons.LoadSetup(datadir, "wind") dumpData = plons.LoadFullDump(dump_file, setupData) - position = dumpData["position"]*1e-2 # position vectors [cm -> m] - velocity = dumpData["velocity"]*1e3 # velocity vectors [km/s -> m/s] + pos_x = dumpData["x"]*1e-2 # x position vectors [cm -> m] + pos_y = dumpData["y"]*1e-2 # y position vectors [cm -> m] + pos_z = dumpData["z"]*1e-2 # z position vectors [cm -> m] + position = np.array((pos_x, pos_y, pos_z)).T + vel_x = dumpData["vx"]*1e3 # x velocity vectors [km/s -> m/s] + vel_y = dumpData["vy"]*1e3 # y velocity vectors [km/s -> m/s] + vel_z = dumpData["vz"]*1e3 # z velocity vectors [km/s -> m/s] + velocity = np.array((vel_x, vel_y, vel_z)).T velocity = velocity/constants.c.si.value # velocity vectors [m/s -> 1/c] rho = dumpData["rho"] # density [g/cm^3] u = dumpData["u"] # internal energy density [erg/g] - tmp = dumpData["Tgas"] # temperature [K] + tmp = dumpData["temp"] # temperature [K] tmp[tmp<2.725] = 2.725 # Cut-off temperatures below 2.725 K # Extract the number of points