From 0618a89d20bc292765618c3567b6a3f834731c07 Mon Sep 17 00:00:00 2001 From: JosePizarro3 Date: Mon, 3 Jun 2024 14:08:50 +0200 Subject: [PATCH] Fix imports in tests --- tests/conftest.py | 16 ++++++++-------- tests/test_atoms_state.py | 2 +- tests/test_band_gap.py | 4 ++-- tests/test_energies.py | 2 +- tests/test_hopping_matrix.py | 5 ++++- tests/test_model_system.py | 2 +- tests/test_numerical_settings.py | 6 +++++- tests/test_outputs.py | 2 +- tests/test_permittivity.py | 12 ++++++------ tests/test_physical_properties.py | 4 ++-- tests/test_spectral_profile.py | 12 ++++++------ tests/test_utils.py | 10 +++++++--- tests/test_variables.py | 2 +- 13 files changed, 45 insertions(+), 34 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 2f62bb31..20b9011e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -26,19 +26,19 @@ from . import logger -from nomad_simulations import Simulation -from nomad_simulations.model_system import ModelSystem, AtomicCell -from nomad_simulations.atoms_state import AtomsState, OrbitalsState -from nomad_simulations.model_method import ModelMethod -from nomad_simulations.numerical_settings import ( +from nomad_simulations.schema import Simulation +from nomad_simulations.schema_sections.model_system import ModelSystem, AtomicCell +from nomad_simulations.schema_sections.atoms_state import AtomsState, OrbitalsState +from nomad_simulations.schema_sections.model_method import ModelMethod +from nomad_simulations.schema_sections.numerical_settings import ( SelfConsistency, KSpace, KMesh as KMeshSettings, KLinePath as KLinePathSettings, ) -from nomad_simulations.outputs import Outputs, SCFOutputs -from nomad_simulations.variables import Energy2 as Energy -from nomad_simulations.properties import ( +from nomad_simulations.schema_sections.outputs import Outputs, SCFOutputs +from nomad_simulations.schema_sections.variables import Energy2 as Energy +from nomad_simulations.schema_sections.properties import ( ElectronicBandGap, DOSProfile, ElectronicDensityOfStates, diff --git a/tests/test_atoms_state.py b/tests/test_atoms_state.py index bcb6b7dd..33fcea38 100644 --- a/tests/test_atoms_state.py +++ b/tests/test_atoms_state.py @@ -25,7 +25,7 @@ from . import logger -from nomad_simulations.atoms_state import ( +from nomad_simulations.schema_sections.atoms_state import ( OrbitalsState, CoreHole, HubbardInteractions, diff --git a/tests/test_band_gap.py b/tests/test_band_gap.py index 1c2b3e63..9a0cbc8f 100644 --- a/tests/test_band_gap.py +++ b/tests/test_band_gap.py @@ -25,8 +25,8 @@ from . import logger -from nomad_simulations.properties import ElectronicBandGap -from nomad_simulations.variables import Temperature +from nomad_simulations.schema_sections.properties import ElectronicBandGap +from nomad_simulations.schema_sections.variables import Temperature class TestElectronicBandGap: diff --git a/tests/test_energies.py b/tests/test_energies.py index f0f52e77..8d5ea540 100644 --- a/tests/test_energies.py +++ b/tests/test_energies.py @@ -16,7 +16,7 @@ # limitations under the License. # -from nomad_simulations.properties import FermiLevel, ChemicalPotential +from nomad_simulations.schema_sections.properties import FermiLevel, ChemicalPotential class TestFermiLevel: diff --git a/tests/test_hopping_matrix.py b/tests/test_hopping_matrix.py index d5d6d8af..b6c1bdbb 100644 --- a/tests/test_hopping_matrix.py +++ b/tests/test_hopping_matrix.py @@ -19,7 +19,10 @@ import pytest import numpy as np -from nomad_simulations.properties import HoppingMatrix, CrystalFieldSplitting +from nomad_simulations.schema_sections.properties import ( + HoppingMatrix, + CrystalFieldSplitting, +) class TestHoppingMatrix: diff --git a/tests/test_model_system.py b/tests/test_model_system.py index 6f3a02e6..698a3ce3 100644 --- a/tests/test_model_system.py +++ b/tests/test_model_system.py @@ -25,7 +25,7 @@ from . import logger from .conftest import generate_atomic_cell -from nomad_simulations.model_system import ( +from nomad_simulations.schema_sections.model_system import ( Symmetry, ChemicalFormula, ModelSystem, diff --git a/tests/test_numerical_settings.py b/tests/test_numerical_settings.py index 11d94ba4..00fbf060 100644 --- a/tests/test_numerical_settings.py +++ b/tests/test_numerical_settings.py @@ -23,7 +23,11 @@ from nomad.units import ureg from nomad.datamodel import EntryArchive -from nomad_simulations.numerical_settings import KMesh, KLinePath, KSpaceFunctionalities +from nomad_simulations.schema_sections.numerical_settings import ( + KMesh, + KLinePath, + KSpaceFunctionalities, +) from . import logger from .conftest import generate_k_line_path, generate_k_space_simulation diff --git a/tests/test_outputs.py b/tests/test_outputs.py index d4efaaa2..cdf6ed46 100644 --- a/tests/test_outputs.py +++ b/tests/test_outputs.py @@ -24,7 +24,7 @@ from . import logger from .conftest import generate_scf_electronic_band_gap_template -from nomad_simulations.outputs import Outputs, ElectronicBandGap +from nomad_simulations.schema_sections.outputs import Outputs, ElectronicBandGap class TestOutputs: diff --git a/tests/test_permittivity.py b/tests/test_permittivity.py index 8e85d10c..8f91703e 100644 --- a/tests/test_permittivity.py +++ b/tests/test_permittivity.py @@ -25,12 +25,12 @@ from . import logger -from nomad_simulations import Simulation -from nomad_simulations.model_system import ModelSystem, AtomicCell -from nomad_simulations.atoms_state import AtomsState -from nomad_simulations.outputs import Outputs -from nomad_simulations.properties import Permittivity -from nomad_simulations.variables import Variables, KMesh, Frequency +from nomad_simulations.schema import Simulation +from nomad_simulations.schema_sections.model_system import ModelSystem, AtomicCell +from nomad_simulations.schema_sections.atoms_state import AtomsState +from nomad_simulations.schema_sections.outputs import Outputs +from nomad_simulations.schema_sections.properties import Permittivity +from nomad_simulations.schema_sections.variables import Variables, KMesh, Frequency from .conftest import generate_k_space_simulation diff --git a/tests/test_physical_properties.py b/tests/test_physical_properties.py index d66c924e..fd7f8893 100644 --- a/tests/test_physical_properties.py +++ b/tests/test_physical_properties.py @@ -25,8 +25,8 @@ from . import logger -from nomad_simulations.variables import Variables -from nomad_simulations.physical_property import PhysicalProperty +from nomad_simulations.schema_sections.variables import Variables +from nomad_simulations.schema_sections.physical_property import PhysicalProperty class DummyPhysicalProperty(PhysicalProperty): diff --git a/tests/test_spectral_profile.py b/tests/test_spectral_profile.py index 14a55034..ae0e1e16 100644 --- a/tests/test_spectral_profile.py +++ b/tests/test_spectral_profile.py @@ -25,17 +25,17 @@ from . import logger -from nomad_simulations import Simulation -from nomad_simulations.model_system import ModelSystem, AtomicCell -from nomad_simulations.atoms_state import AtomsState -from nomad_simulations.outputs import Outputs -from nomad_simulations.properties import ( +from nomad_simulations.schema import Simulation +from nomad_simulations.schema_sections.model_system import ModelSystem, AtomicCell +from nomad_simulations.schema_sections.atoms_state import AtomsState +from nomad_simulations.schema_sections.outputs import Outputs +from nomad_simulations.schema_sections.properties import ( SpectralProfile, ElectronicDensityOfStates, AbsorptionSpectrum, XASSpectrum, ) -from nomad_simulations.variables import Energy2 as Energy +from nomad_simulations.schema_sections.variables import Energy2 as Energy class TestSpectralProfile: diff --git a/tests/test_utils.py b/tests/test_utils.py index 5a498952..cfd4df71 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -21,13 +21,17 @@ from nomad.units import ureg -from nomad_simulations.utils import ( +from nomad_simulations.schema_sections.utils import ( get_sibling_section, is_not_representative, get_variables, ) -from nomad_simulations.model_system import ModelSystem, AtomicCell, Symmetry -from nomad_simulations.variables import Temperature, Energy2 as Energy +from nomad_simulations.schema_sections.model_system import ( + ModelSystem, + AtomicCell, + Symmetry, +) +from nomad_simulations.schema_sections.variables import Temperature, Energy2 as Energy from . import logger diff --git a/tests/test_variables.py b/tests/test_variables.py index ab71b4a2..82bd49b8 100644 --- a/tests/test_variables.py +++ b/tests/test_variables.py @@ -22,7 +22,7 @@ from . import logger -from nomad_simulations.variables import Variables +from nomad_simulations.schema_sections.variables import Variables class TestVariables: