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

Improve performace of TiledDataset repr #467

Merged
merged 7 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/467.performance.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve the performance of the ``TiledDataset`` ``repr`` and ``str``.
1 change: 1 addition & 0 deletions changelog/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Each file should be named like ``<PULL REQUEST>.<TYPE>.rst``, where ``<PULL REQU
* ``breaking``: A change which requires users to change code and is not backwards compatible. (Not to be used for removal of deprecated features.)
* ``feature``: New user facing features and any new behavior.
* ``bugfix``: Fixes a reported bug.
* ``performance``: A performance improvement which does not change behaviour.
* ``doc``: Documentation addition or improvement, like rewording an entire session or adding missing docs.
* ``removal``: Feature deprecation and/or feature removal.
* ``trivial``: A change which has no user facing effect or is tiny change.
Expand Down
6 changes: 3 additions & 3 deletions dkist/dataset/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@


def dataset_info_str(ds_in):
# Check for an attribute that only appears on TiledDataset
# Not using isinstance to avoid circular import
is_tiled = hasattr(ds_in, "combined_headers")
# Import here to remove circular import
from dkist.dataset import TiledDataset
is_tiled = isinstance(ds_in, TiledDataset)

Check warning on line 17 in dkist/dataset/utils.py

View check run for this annotation

Codecov / codecov/patch

dkist/dataset/utils.py#L16-L17

Added lines #L16 - L17 were not covered by tests
dstype = type(ds_in).__name__
if is_tiled:
tile_shape = ds_in.shape
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,8 @@ write_to = "dkist/_version.py"
directory = "trivial"
name = "Trivial/Internal Changes"
showcontent = true

[[tool.towncrier.type]]
directory = "performance"
name = "Performance Improvements"
showcontent = true
Loading