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

DM-43101: Add exposure.can_see_sky metadata field #979

Merged
merged 19 commits into from Mar 28, 2024
Merged

Conversation

timj
Copy link
Member

@timj timj commented Mar 19, 2024

No attempt is made to generate a value when importing from an old universe. (replaces #972)

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes
  • (if changing dimensions.yaml) make a copy of dimensions.yaml in configs/old_dimensions

Copy link

codecov bot commented Mar 19, 2024

Codecov Report

Attention: Patch coverage is 86.84211% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 88.92%. Comparing base (6753f97) to head (54901b4).

Files Patch % Lines
tests/test_server.py 60.00% 2 Missing ⚠️
python/lsst/daf/butler/dimensions/_graph.py 0.00% 0 Missing and 1 partial ⚠️
python/lsst/daf/butler/dimensions/_group.py 0.00% 0 Missing and 1 partial ⚠️
python/lsst/daf/butler/logging.py 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #979      +/-   ##
==========================================
- Coverage   88.92%   88.92%   -0.01%     
==========================================
  Files         329      329              
  Lines       42349    42351       +2     
  Branches     8704     8704              
==========================================
  Hits        37660    37660              
- Misses       3439     3441       +2     
  Partials     1250     1250              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@TallJimbo TallJimbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to revert the Union -> | commit and tell Ruff to either ignore that rule (ideal) or ignore at least the majority of those lines, as I think Union is better for anything multi-line (or potentially multi-line in the future).

I'm also not sold on the Self commit, as that is a subtle definition change rather than just notation, when inheritance is in play; I prefer not to use Self unless I want to say that derived classes must return the most-derived type. Looks like we could be using from __future__ import annotations in ButlerLogRecords instead, though - probably dates from when pydantic couldn't handle that.

python/lsst/daf/butler/timespan_database_representation.py Outdated Show resolved Hide resolved
@@ -42,7 +44,7 @@ class SupportsSimple(Protocol):
serialization using "simple" methods names.
"""

_serializedType: Type
_serializedType: type[BaseModel]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should actually by ClassVar[type[BaseModel]], I suspect.

Aside: this is correct for the code as it is now, but I think we really want to support things that are recognized by Pydantic other than BaseModel (like typing.TypedDict) as "simple" objects in the future. I think that would involve making this into:

class SupportsSimple(Protocol, Generic[_T]):

    _adapter: ClassVar[pydantic.TypeAdapter[_T]]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, but TypeAdapter doesn't support model_dump_json which is what the code relies on (it's called dump_json with TypeAdapter).

I'll do your ClassVar fix.

@timj timj mentioned this pull request Mar 27, 2024
3 tasks
@timj timj merged commit 9f02822 into main Mar 28, 2024
16 of 18 checks passed
@timj timj deleted the tickets/DM-43101 branch March 28, 2024 03:08
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.

None yet

2 participants