Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pattern generator tests #436

Merged
merged 10 commits into from
Jul 16, 2024
Merged

Fix pattern generator tests #436

merged 10 commits into from
Jul 16, 2024

Conversation

subinsaji
Copy link
Contributor

Fixes #432

@subinsaji subinsaji self-assigned this Jul 10, 2024
@subinsaji subinsaji changed the title 432 fix pattern generator tests Fix pattern generator tests Jul 11, 2024
@subinsaji
Copy link
Contributor Author

There is a lot of overlapping logic with hdf_writer.py :

self._datasets = [
_HDFDataset(
data_key=name,
dataset="/entry/data/data",
shape=frame_shape,
dtype_numpy=dtype_numpy,
multiplier=multiplier,
)
]
# And all the scalar datasets
for ds_name, ds_path in self._scalar_datasets_paths.items():
self._datasets.append(
_HDFDataset(
f"{name}-{ds_name}",
f"/entry/instrument/NDAttributes/{ds_path}",
(),
"",
multiplier,
)
)
describe = {
ds.data_key: DataKey(
source=self.hdf.full_file_name.source,
shape=outer_shape + tuple(ds.shape),
dtype="array" if ds.shape else "number",
dtype_numpy=ds.dtype_numpy,
external="STREAM:",
)
for ds in self._datasets
}
return describe

and also with panda _hdf_writer.py :

describe = {
ds.data_key: DataKey(
source=self.panda_device.data.hdf_directory.source,
shape=ds.shape,
dtype="array" if ds.shape != [1] else "number",
dtype_numpy="<f8", # PandA data should always be written as Float64
external="STREAM:",
)
for ds in self._datasets
}
return describe

From a DRY point of view, we can reduce this repeating logic

@subinsaji subinsaji requested a review from coretl July 12, 2024 15:31
@subinsaji subinsaji marked this pull request as ready for review July 12, 2024 15:31
@subinsaji subinsaji marked this pull request as draft July 12, 2024 15:31
@subinsaji subinsaji marked this pull request as ready for review July 12, 2024 15:38
@subinsaji subinsaji merged commit ca8a8b6 into main Jul 16, 2024
18 checks passed
@subinsaji subinsaji deleted the 432-fix-PatternGenerator-tests branch July 16, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pattern Generator dataset creation is not correct, and has no tests to catch it.
2 participants