Skip to content

Commit

Permalink
Fixed name of ref in KMesh and KLinePath variables
Browse files Browse the repository at this point in the history
  • Loading branch information
JosePizarro3 committed May 21, 2024
1 parent eb5fc60 commit 16f9fa5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/nomad_simulations/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class KMesh(Variables):
other k-space properties. The `points` are obtained from a refernece to the `NumericalSettings` section, `KMesh(NumericalSettings)`.
"""

k_mesh_ref = Quantity(
k_mesh_settings_ref = Quantity(
type=KMeshSettings,
description="""
Reference to the `KMesh(NumericalSettings)` section in the `ModelMethod` section. This reference is useful
Expand Down Expand Up @@ -211,7 +211,7 @@ def normalize(self, archive, logger) -> None:
class KLinePath(Variables):
""" """

k_line_path_ref = Quantity(
k_line_path_settings_ref = Quantity(
type=KLinePathSettings,
description="""
Reference to the `KLinePath(NumericalSettings)` section in the `ModelMethod.KMesh` section. This reference is useful
Expand All @@ -235,19 +235,19 @@ def __init__(

def extract_points(self, logger: BoundLogger) -> Optional[list]:
"""
Extract the `points` list from the `k_line_path_ref` pointing to the `KLinePath` section.
Extract the `points` list from the `k_line_path_settings_ref` pointing to the `KLinePath` section.
Args:
logger (BoundLogger): The logger to log messages.
Returns:
(Optional[list]): The `points` list.
"""
if self.k_line_path_ref is not None:
return self.k_line_path_ref.points
logger.error('`k_line_path_ref` is not defined.')
if self.k_line_path_settings_ref is not None:
return self.k_line_path_settings_ref.points
logger.error('`k_line_path_settings_ref` is not defined.')
return None

def normalize(self, archive, logger) -> None:
# Extracting `points` from the `k_line_path_ref` BEFORE doing `super().normalize()`
# Extracting `points` from the `k_line_path_settings_ref` BEFORE doing `super().normalize()`
self.points = self.extract_points(logger)

super().normalize(archive, logger)

0 comments on commit 16f9fa5

Please sign in to comment.