Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
Merge dnd builder methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jl-wynen committed Nov 1, 2024
1 parent ad0033e commit b1a7f9a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/sqomega/_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,17 @@ def add_empty_detector_params(self) -> SqwBuilder:
)
return self

def add_dnd_metadata(self, block: SqwDndMetadata) -> SqwBuilder:
def _add_dnd_metadata(self, block: SqwDndMetadata) -> SqwBuilder:
self._data_blocks[("data", "metadata")] = block
return self

def add_empty_dnd_data(self) -> SqwBuilder:
self._dnd_placeholder = _DndPlaceholder(shape=(50, 50, 50, 50))
return self
def add_empty_dnd_data(self, block: SqwDndMetadata) -> SqwBuilder:
# The file must always contain a DND block
builder = self._add_dnd_metadata(block)
builder._dnd_placeholder = _DndPlaceholder(
shape=tuple(map(int, block.axes.n_bins_all_dims))
)
return builder

def add_default_instrument(self, instrument: SqwIXNullInstrument) -> SqwBuilder:
self._instrument = instrument
Expand Down

0 comments on commit b1a7f9a

Please sign in to comment.