Skip to content

Commit

Permalink
Hotfix imports utils
Browse files Browse the repository at this point in the history
  • Loading branch information
JosePizarro3 committed Jul 1, 2024
1 parent a8f7cba commit 97487d2
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/nomad_simulations/schema_packages/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,22 @@
#

from math import factorial
from typing import List, Optional
from typing import TYPE_CHECKING

import numpy as np
from nomad.datamodel.data import ArchiveSection
from structlog.stdlib import BoundLogger

if TYPE_CHECKING:
from typing import List, Optional
from nomad.datamodel.data import ArchiveSection
from structlog.stdlib import BoundLogger


def get_sibling_section(
section: ArchiveSection,
section: 'ArchiveSection',
sibling_section_name: str,
logger: BoundLogger,
logger: 'BoundLogger',
index_sibling: int = 0,
) -> Optional[ArchiveSection]:
) -> 'Optional[ArchiveSection]':
"""
Gets the sibling section of a section by performing a seesaw move by going to the parent
of the section and then going down to the sibling section. This is used, e.g., to get
Expand Down Expand Up @@ -112,7 +115,7 @@ def degeneracy(self):
)


def is_not_representative(model_system, logger: BoundLogger):
def is_not_representative(model_system, logger: 'BoundLogger'):
"""
Checks if the given `ModelSystem` is not representative and logs a warning.
Expand All @@ -133,8 +136,8 @@ def is_not_representative(model_system, logger: BoundLogger):

# cannot define typing with `Variables` due to circular import issue
def get_variables(
variables: Optional[List[ArchiveSection]], variable_cls: ArchiveSection
) -> List[ArchiveSection]:
variables: 'Optional[List[ArchiveSection]]', variable_cls: 'ArchiveSection'
) -> 'List[ArchiveSection]':
"""
Get the list of variables which are of type `variable_cls` and appear under `variables`.
Expand All @@ -155,7 +158,7 @@ def get_variables(


# TODO remove function in nomad.atomutils
def get_composition(children_names: List[str]) -> str:
def get_composition(children_names: 'List[str]') -> str:
"""
Generates a generalized "chemical formula" based on the provided list `children_names`,
with the format X(m)Y(n) for children_names X and Y of quantities m and n, respectively.
Expand Down

1 comment on commit 97487d2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/nomad_simulations
   __init__.py4250%3–4
   _version.py11282%5–6
src/nomad_simulations/schema_packages
   __init__.py14286%53–55
   atoms_state.py1902189%32–34, 220–223, 247, 302–303, 371–372, 374, 556, 568–569, 630–634, 649–653, 660
   general.py75791%30–31, 99, 163, 273–274, 284
   model_method.py2657771%29–31, 190–193, 196–203, 295–296, 316, 337–356, 372–398, 401–418, 772, 783, 825–832, 870, 889, 969, 1026, 1101, 1215
   model_system.py2612292%45–47, 514–517, 565–572, 746–747, 969–973, 979–980, 988–989, 994, 1017
   numerical_settings.py2636575%32–34, 166, 236, 238–239, 242–245, 249–250, 257–260, 269–272, 276–279, 281–284, 289–292, 298–301, 472–499, 574, 609–612, 636, 639, 684, 686–689, 693, 697, 744, 748–769, 824–825, 892, 901–903, 906
   outputs.py101892%26–27, 230–233, 273–276, 301, 303
   physical_property.py94496%38–40, 219
   variables.py641183%27–29, 115, 138, 158–159, 162, 184, 207, 227
src/nomad_simulations/schema_packages/properties
   band_gap.py51590%27–29, 154–155
   band_structure.py1112280%28–30, 250–283, 296, 303, 339–340, 343
   energies.py26581%26–28, 58, 86
   fermi_surface.py17476%26–28, 59
   hopping_matrix.py29583%26–28, 76, 111
   permittivity.py48883%26–28, 116–124
   spectral_profile.py25612452%28–30, 76–79, 114–117, 218–319, 375–387, 412–415, 435, 440–443, 485–521, 545, 592–595, 611–612, 617–623
src/nomad_simulations/schema_packages/utils
   utils.py681479%26–28, 78–87, 96–97, 102, 105
TOTAL195640879% 

Tests Skipped Failures Errors Time
303 0 💤 0 ❌ 0 🔥 2.319s ⏱️

Please sign in to comment.