This repository was archived by the owner on Nov 6, 2025. It is now read-only.
Conversation
…y if using a True argument
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 5.0.x_dev #46 +/- ##
==========================================
Coverage 76.49% 76.50%
==========================================
Files 17 17
Lines 3795 3796 +1
==========================================
+ Hits 2903 2904 +1
Misses 892 892 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
seb5g
added a commit
to PyMoDAQ/PyMoDAQ
that referenced
this pull request
Jul 15, 2025
see PyMoDAQ/pymodaq_data#46 for a patch on the subject
malik-irain
reviewed
Jul 16, 2025
Contributor
malik-irain
left a comment
There was a problem hiding this comment.
Lots of comments to suggest renaming sort_name with sort_by_name
src/pymodaq_data/data.py
Outdated
| return dims | ||
|
|
||
| def get_data_from_source(self, source: DataSource, deepcopy=False) -> DataToExport: | ||
| def get_data_from_source(self, source: DataSource, deepcopy=False, sort_name=False) -> DataToExport: |
Contributor
There was a problem hiding this comment.
I would have named the new parameter sort_by_name as it feels a more "boolean" name than sort_name that could seem to mean it needs a sort algorithm name
src/pymodaq_data/data.py
Outdated
| """ | ||
| source = enum_checker(DataSource, source) | ||
| return self.get_data_from_attribute('source', source, deepcopy=deepcopy) | ||
| return self.get_data_from_attribute('source', source, deepcopy=deepcopy, sort_name=sort_name) |
src/pymodaq_data/data.py
Outdated
| def get_data_from_attribute(self, attribute: str, | ||
| attribute_value: Any, | ||
| deepcopy=False, | ||
| sort_name=False) -> DataToExport: |
| deepcopy: bool | ||
| If True, the returned data are deepcopied from the original | ||
| sort_name: bool | ||
| If True the returned data are sorted alphabetically using their name, default is False |
src/pymodaq_data/data.py
Outdated
| selection = find_objects_in_list_from_attr_name_val(self.data, attribute, attribute_value, | ||
| return_first=False) | ||
| selection.sort(key=lambda elt: elt[0].name) | ||
| if sort_name: |
src/pymodaq_data/data.py
Outdated
| return DataToExport(name=self.name, data=data) | ||
|
|
||
| def get_data_from_dim(self, dim: DataDim, deepcopy=False) -> DataToExport: | ||
| def get_data_from_dim(self, dim: DataDim, deepcopy=False, sort_name=False) -> DataToExport: |
src/pymodaq_data/data.py
Outdated
| """ | ||
| dim = enum_checker(DataDim, dim) | ||
| return self.get_data_from_attribute('dim', dim, deepcopy=deepcopy) | ||
| return self.get_data_from_attribute('dim', dim, deepcopy=deepcopy, sort_name=sort_name) |
src/pymodaq_data/data.py
Outdated
| return self.get_data_from_attribute('dim', dim, deepcopy=deepcopy, sort_name=sort_name) | ||
|
|
||
| def get_data_from_dims(self, dims: List[DataDim], deepcopy=False) -> DataToExport: | ||
| def get_data_from_dims(self, dims: List[DataDim], deepcopy=False, sort_name=False) -> DataToExport: |
src/pymodaq_data/data.py
Outdated
| data = DataToExport(name=self.name) | ||
| for dim in dims: | ||
| data.append(self.get_data_from_dim(dim, deepcopy=deepcopy)) | ||
| data.append(self.get_data_from_dim(dim, deepcopy=deepcopy, sort_name=sort_name)) |
tests/data_test.py
Outdated
| data.append(dat4) | ||
| assert data.get_data_from_dim(data_mod.DataDim['Data2D']).data == [dat1, dat4] | ||
| assert data.get_data_from_dim(data_mod.DataDim.Data2D).data == [dat1, dat4] | ||
| assert data.get_data_from_dim(data_mod.DataDim.Data2D, sort_name=True).data == [dat4, dat1] |
malik-irain
approved these changes
Jul 16, 2025
seb5g
added a commit
to PyMoDAQ/PyMoDAQ
that referenced
this pull request
Jul 16, 2025
see PyMoDAQ/pymodaq_data#46 for a patch on the subject
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Was creating a bug in the ordering of data plotted by bayesian and adaptive extensions