diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5bce7d4c..16db758fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,15 +13,14 @@ jobs: uses: conda-incubator/setup-miniconda@v2 with: activate-environment: myenv - mamba-version: "*" + # mamba-version: "*" channels: conda-forge, defaults - name: Create Conda environment shell: bash -l {0} run: | # conda upgrade --strict-channel-priority -c conda-forge --all - conda install -c conda-forge 'conda-libmamba-solver<23.9' - mamba install -c conda-forge fenics + conda install -c conda-forge fenics numpy=1.24 python=3.10 - name: Install dependencies shell: bash -l {0} diff --git a/docs/source/userguide/export_post_processing.rst b/docs/source/userguide/export_post_processing.rst index 5fbcbb5b1..6f1a597bf 100644 --- a/docs/source/userguide/export_post_processing.rst +++ b/docs/source/userguide/export_post_processing.rst @@ -189,7 +189,7 @@ The data can be accessed in three different ways: print(flux_surf_3.t) print(flux_surf_3.data) - print(my_derived_quantities.derived_quantities[2].data) + print(my_derived_quantities[2].data) - export and read from a .csv file: diff --git a/festim/generic_simulation.py b/festim/generic_simulation.py index 953b4b8d0..8c1d2cb40 100644 --- a/festim/generic_simulation.py +++ b/festim/generic_simulation.py @@ -326,7 +326,7 @@ def initialise(self): for export in self.exports: if isinstance(export, festim.DerivedQuantities): - for q in export.derived_quantities: + for q in export: if not isinstance(q, tuple(allowed_quantities[self.mesh.type])): warnings.warn( f"{type(q)} may not work as intended for {self.mesh.type} meshes" diff --git a/test/simulation/test_postprocessing_integration.py b/test/simulation/test_postprocessing_integration.py index 6681dc398..8cae53a7c 100644 --- a/test/simulation/test_postprocessing_integration.py +++ b/test/simulation/test_postprocessing_integration.py @@ -174,6 +174,7 @@ def test_fluxes(self, my_sim): assert np.isclose(data[1][3], -1 * grad_T * lambda_x_0) assert np.isclose(data[1][4], -1 * grad_T * lambda_x_1 * -1) + @pytest.mark.filterwarnings("ignore:in 1D") def test_performance_xdmf_export_every_N_iterations(self, my_sim, tmpdir): """Runs run_post_processing several times with different export.mode values and checks that the xdmf @@ -215,6 +216,7 @@ def test_performance_xdmf_export_every_N_iterations(self, my_sim, tmpdir): for t_expected, t in zip(expected_times, times): assert t_expected == pytest.approx(float(t)) + @pytest.mark.filterwarnings("ignore:in 1D") def test_xdmf_export_only_last_timestep(self, my_sim, tmpdir): """Runs run_post_processing with mode="last": - when the time is not the final time and checks that nothing has been diff --git a/test/unit/test_exports/test_derived_quantities/test_surface_quantity.py b/test/unit/test_exports/test_derived_quantities/test_surface_quantity.py index e790ef9d2..20849490e 100644 --- a/test/unit/test_exports/test_derived_quantities/test_surface_quantity.py +++ b/test/unit/test_exports/test_derived_quantities/test_surface_quantity.py @@ -1,4 +1,3 @@ -from nis import match import festim as F import pytest diff --git a/test/unit/test_exports/test_derived_quantities/test_volume_quantity.py b/test/unit/test_exports/test_derived_quantities/test_volume_quantity.py index 4a2cb56b2..7ec88f0f8 100644 --- a/test/unit/test_exports/test_derived_quantities/test_volume_quantity.py +++ b/test/unit/test_exports/test_derived_quantities/test_volume_quantity.py @@ -1,4 +1,3 @@ -from nis import match import festim as F import pytest diff --git a/test/unit/test_exports/test_trap_density_xdmf_export.py b/test/unit/test_exports/test_trap_density_xdmf_export.py index a0f7a41d1..2b02d9425 100644 --- a/test/unit/test_exports/test_trap_density_xdmf_export.py +++ b/test/unit/test_exports/test_trap_density_xdmf_export.py @@ -3,6 +3,7 @@ import sympy as sp from pathlib import Path import numpy as np +import pytest def test_trap_density_xdmf_export_intergration_with_simultion(tmpdir): @@ -96,6 +97,7 @@ def test_trap_density_xdmf_export_write(tmpdir): assert error_L2 < 1e-10 +@pytest.mark.filterwarnings("ignore:in 1D") def test_trap_density_xdmf_export_traps_materials_mixed(tmpdir): """Integration test for TrapDensityXDMF.write() with a trap material given as a string. Creates a festim simulation and exports the trap density as an diff --git a/test/unit/test_exports/test_xdmf_export.py b/test/unit/test_exports/test_xdmf_export.py index 900ae5ab7..f7973d153 100644 --- a/test/unit/test_exports/test_xdmf_export.py +++ b/test/unit/test_exports/test_xdmf_export.py @@ -10,7 +10,7 @@ def folder(tmpdir): def test_define_file_upon_construction(folder): - mesh = f.UnitIntervalMesh(10) + mesh = f.UnitSquareMesh(8, 8) filename = "{}/my_filename.xdmf".format(folder) my_xdmf = XDMFExport("solute", label="solute_label", filename=filename) @@ -30,7 +30,7 @@ def test_default_filename(): class TestDefineFile: - mesh = f.UnitIntervalMesh(10) + mesh = f.UnitSquareMesh(8, 8) my_xdmf = XDMFExport("solute", "my_label", filename="my_filename.xdmf") def test_file_exists(self, folder): @@ -44,7 +44,7 @@ def test_file_exists(self, folder): class TestWrite: - mesh = f.UnitIntervalMesh(10) + mesh = f.UnitSquareMesh(8, 8) V = f.FunctionSpace(mesh, "P", 1) u = f.Function(V) label_to_function = {"solute": u}