Skip to content

Commit

Permalink
Use auxiliary_signals with relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
ndaelman committed Dec 20, 2024
1 parent 439fc3e commit 60f8a5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/nomad_parser_plugin_boss/parsers/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,7 @@ def parse(
res = BOResults.from_file(
mainfile, os.path.join(os.path.dirname(mainfile), 'boss.out')
)
iter_no, no_grid_points = (
res.settings.get('iterpts', 1),
50,
) # ! make more robust, 250
iter_no, no_grid_points = (res.settings.get('iterpts', 1), 50) # ! 250
pp = PPMain(
res,
pp_models=True,
Expand All @@ -126,7 +123,6 @@ def compute_parameters(rank: int):

# Set up the archive
archive.data = PotentialEnergySurfaceFit()
archive.data.m_annotations['h5web'] = H5WebAnnotation(paths=[])

# Generate slices
for parameter_counter, rank in enumerate(generate_slices()):
Expand Down Expand Up @@ -154,7 +150,11 @@ def compute_parameters(rank: int):
# Save slices
slice_path = f'parameter_slices/{parameter_counter}'
section = archive.data.m_setdefault(slice_path)
archive.data.m_annotations['h5web'].paths.append(slice_path)
if iteration == 0:
archive.data.parameter_slices[0].m_annotations['h5web'] = H5WebAnnotation(auxiliary_signals=[])
else:
archive.data.parameter_slices[0].m_annotations['h5web'].auxiliary_signals.append('../' + slice_path)

section.fitted_values = np.array(mu_all_slices)
section.parameter_1_values = np.array([[compute_parameters(main_rank)]])
section.parameter_2_values = np.array([[compute_parameters(upper_rank)]])
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ParameterSpaceSlice(Schema):

class PotentialEnergySurfaceFit(Schema):
m_def = Section(
a_h5web=H5WebAnnotation(title='Potential Energy Surface Fit'),
a_h5web=H5WebAnnotation(title='Potential Energy Surface Fit', paths=['parameter_slices/0']),
)

parameter_names = Quantity(
Expand Down

0 comments on commit 60f8a5c

Please sign in to comment.