pymmcore-plus / useq-schema

An implementation agnostic schema for describing a sequence of events during a multi-dimensional imaging acquisition.
https://pymmcore-plus.github.io/useq-schema/
BSD 3-Clause "New" or "Revised" License
15 stars 5 forks source link

feat: support both pydantic1 and pydantic2 #122

Closed tlambert03 closed 1 year ago

tlambert03 commented 1 year ago

This PR unpins pydantic and allows useq-schema to work with both pydantic1 and pydantic2.

it ain't pretty! but it's an important step forward

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 98.98% and project coverage change: +1.79% :tada:

Comparison is base (9e60030) 96.49% compared to head (790d1a9) 98.29%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #122 +/- ## ========================================== + Coverage 96.49% 98.29% +1.79% ========================================== Files 14 15 +1 Lines 827 878 +51 ========================================== + Hits 798 863 +65 + Misses 29 15 -14 ``` | [Files Changed](https://app.codecov.io/gh/pymmcore-plus/useq-schema/pull/122?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymmcore-plus) | Coverage Δ | | |---|---|---| | [src/useq/\_pydantic\_compat.py](https://app.codecov.io/gh/pymmcore-plus/useq-schema/pull/122?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymmcore-plus#diff-c3JjL3VzZXEvX3B5ZGFudGljX2NvbXBhdC5weQ==) | `96.29% <96.29%> (ø)` | | | [src/useq/\_\_init\_\_.py](https://app.codecov.io/gh/pymmcore-plus/useq-schema/pull/122?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymmcore-plus#diff-c3JjL3VzZXEvX19pbml0X18ucHk=) | `100.00% <100.00%> (ø)` | | | [src/useq/\_base\_model.py](https://app.codecov.io/gh/pymmcore-plus/useq-schema/pull/122?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymmcore-plus#diff-c3JjL3VzZXEvX2Jhc2VfbW9kZWwucHk=) | `100.00% <100.00%> (+12.50%)` | :arrow_up: | | [src/useq/\_channel.py](https://app.codecov.io/gh/pymmcore-plus/useq-schema/pull/122?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymmcore-plus#diff-c3JjL3VzZXEvX2NoYW5uZWwucHk=) | `100.00% <100.00%> (+7.40%)` | :arrow_up: | | [src/useq/\_grid.py](https://app.codecov.io/gh/pymmcore-plus/useq-schema/pull/122?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymmcore-plus#diff-c3JjL3VzZXEvX2dyaWQucHk=) | `100.00% <100.00%> (ø)` | | | [src/useq/\_hardware\_autofocus.py](https://app.codecov.io/gh/pymmcore-plus/useq-schema/pull/122?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymmcore-plus#diff-c3JjL3VzZXEvX2hhcmR3YXJlX2F1dG9mb2N1cy5weQ==) | `100.00% <100.00%> (ø)` | | | [src/useq/\_iter\_sequence.py](https://app.codecov.io/gh/pymmcore-plus/useq-schema/pull/122?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymmcore-plus#diff-c3JjL3VzZXEvX2l0ZXJfc2VxdWVuY2UucHk=) | `100.00% <100.00%> (ø)` | | | [src/useq/\_mda\_event.py](https://app.codecov.io/gh/pymmcore-plus/useq-schema/pull/122?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymmcore-plus#diff-c3JjL3VzZXEvX21kYV9ldmVudC5weQ==) | `87.23% <100.00%> (+8.97%)` | :arrow_up: | | [src/useq/\_mda\_sequence.py](https://app.codecov.io/gh/pymmcore-plus/useq-schema/pull/122?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymmcore-plus#diff-c3JjL3VzZXEvX21kYV9zZXF1ZW5jZS5weQ==) | `98.67% <100.00%> (+0.21%)` | :arrow_up: | | [src/useq/\_position.py](https://app.codecov.io/gh/pymmcore-plus/useq-schema/pull/122?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymmcore-plus#diff-c3JjL3VzZXEvX3Bvc2l0aW9uLnB5) | `100.00% <100.00%> (+4.00%)` | :arrow_up: | | ... and [3 more](https://app.codecov.io/gh/pymmcore-plus/useq-schema/pull/122?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymmcore-plus) | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

tlambert03 commented 1 year ago

hooray! glad to have that one done :joy: