Skip to content

Rework level 2 __repr__s for consistency with level 1 - #745

Open
SolarDrew wants to merge 22 commits into
DKISTDC:mainfrom
SolarDrew:inv-repr
Open

Rework level 2 __repr__s for consistency with level 1#745
SolarDrew wants to merge 22 commits into
DKISTDC:mainfrom
SolarDrew:inv-repr

Conversation

@SolarDrew

Copy link
Copy Markdown
Contributor

Closes #675

Scraps the basic repr for Inversion and Profiles, which is currently a slight variation on the NDCollection repr, and replaces it with a more detailed one based on the info string developed previously for Dataset and TiledDataset.

@codspeed-hq

codspeed-hq Bot commented Aug 11, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 10.66%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 3 regressed benchmarks
✅ 13 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation test_dataset_repr 14.4 ms 16.9 ms -14.77%
Simulation test_tileddataset_repr[simple-masked] 6.2 ms 6.8 ms -8.58%
Simulation test_tileddataset_repr[simple-nomask] 6.3 ms 6.9 ms -8.48%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing SolarDrew:inv-repr (dd3fb81) with main (e71f49b)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (3e0636d) during the generation of this report, so e71f49b was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@SolarDrew

Copy link
Copy Markdown
Contributor Author

Example Inversion repr:

<dkist.dataset.inversion.Inversion object at 0x7f13b0b4c4a0>
This Level 2 product is a dictionary of 11 Datasets with 3 aligned dimensions and consists of 4664 total frames.
Files are stored in /home/drew/oss-projects/dkist/dkist/data/test

This Inversion has ID ...

The Datasets in this Inversion represent the following 11 physical parameters:
- optical_depth
- temperature
- electron_pressure
- microturbulence
- mag_strength
- velocity
- mag_inclination
- mag_azimuth
- geo_height
- gas_pressure
- density

These parameters were calculated using the following 3 line profiles (see the .profiles attribute for more information) :
- NaID
- FeI630
- CaII854

These Datasets share 3 pixel and 5 world dimensions.The shared pixel axes have shape [424, 508, 81].

Array Dim  Axis Name      Data size  Bounds
        0  frame_y             None  None
        1  slit_x              None  None
        2  optical_depth       None  None

World Dim  Axis Name                Physical Type                   Units
        4  stokes                   phys.polarization.stokes        unknown
        3  isot(utc; None           time                            s
        2  pos.helioprojective.lat  custom:pos.helioprojective.lat  arcsec
        1  pos.helioprojective.lon  custom:pos.helioprojective.lon  arcsec
        0  optical depth            phys.absorption.opticalDepth    pixel

Correlation between pixel and world axes:

                        |                PIXEL DIMENSIONS
       WORLD DIMENSIONS | optical_depth |     slit_x    |    frame_y
----------------------- | ------------- | ------------- | -------------
          optical depth |       x       |               |
pos.helioprojective.lon |               |       x       |       x
pos.helioprojective.lat |               |       x       |       x
         isot(utc; None |               |               |       x
                 stokes |               |       x       |

The above WCS information relates to only the pixel axes shared by all inversions, and the
corresponding world axes. Invdividual inversions may include other coordinate information.

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.

Better repr for Inversion and Profiles classes

1 participant