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-45860: Expand support for SIAv2 and VOTable #18

Merged
merged 71 commits into from
Oct 4, 2024
Merged

Conversation

timj
Copy link
Member

@timj timj commented Aug 27, 2024

@timj timj force-pushed the tickets/DM-45860 branch 2 times, most recently from 5f3c642 to 44d39ea Compare August 27, 2024 18:58
Copy link

codecov bot commented Aug 27, 2024

Codecov Report

Attention: Patch coverage is 92.43570% with 50 lines in your changes missing coverage. Please review.

Project coverage is 82.30%. Comparing base (6892e05) to head (06a2bc1).
Report is 72 commits behind head on main.

Files with missing lines Patch % Lines
python/lsst/dax/obscore/siav2.py 93.09% 9 Missing and 10 partials ⚠️
python/lsst/dax/obscore/obscore_exporter.py 88.42% 10 Missing and 4 partials ⚠️
python/lsst/dax/obscore/script/obscore_siav2.py 64.28% 5 Missing ⚠️
python/lsst/dax/obscore/script/obscore_export.py 33.33% 4 Missing ⚠️
python/lsst/dax/obscore/config.py 93.33% 2 Missing and 1 partial ⚠️
tests/test_siav2.py 98.07% 1 Missing and 1 partial ⚠️
tests/test_where.py 93.33% 1 Missing and 1 partial ⚠️
python/lsst/dax/obscore/cli/cmd/commands.py 93.75% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #18       +/-   ##
===========================================
+ Coverage   62.03%   82.30%   +20.27%     
===========================================
  Files          11       16        +5     
  Lines         461     1074      +613     
  Branches      107      276      +169     
===========================================
+ Hits          286      884      +598     
+ Misses        166      165        -1     
- Partials        9       25       +16     

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

@timj timj force-pushed the tickets/DM-45860 branch 5 times, most recently from 75b80cc to 1e534cc Compare August 29, 2024 19:52
@timj timj force-pushed the tickets/DM-45860 branch 4 times, most recently from 44661ba to 9b66b4f Compare August 31, 2024 00:21
Copy link
Contributor

@andy-slac andy-slac left a comment

Choose a reason for hiding this comment

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

Jsu commenting, as this is still a draft PR. Looks good, one concern is handling of regexes for collection names in obscore config, this is not going to work with the new query system. And there are assumptions about dimension names, but you know this already.

configs/ci_hsc_gen3.yaml Outdated Show resolved Hide resolved
python/lsst/dax/obscore/cli/cmd/commands.py Outdated Show resolved Hide resolved
python/lsst/dax/obscore/cli/cmd/commands.py Show resolved Hide resolved
python/lsst/dax/obscore/config.py Show resolved Hide resolved
python/lsst/dax/obscore/config.py Show resolved Hide resolved
python/lsst/dax/obscore/siav2.py Outdated Show resolved Hide resolved
python/lsst/dax/obscore/siav2.py Outdated Show resolved Hide resolved
python/lsst/dax/obscore/siav2.py Outdated Show resolved Hide resolved
python/lsst/dax/obscore/siav2.py Outdated Show resolved Hide resolved
python/lsst/dax/obscore/obscore_exporter.py Outdated Show resolved Hide resolved
@timj
Copy link
Member Author

timj commented Sep 3, 2024

And there are assumptions about dimension names,

I designed it so that the assumptions about dimension names are isolated in SIAv2Handler. In the future the handler class will be a parameter of the SIAv2 obscore configuration.

Butler ObsCore itself is a much bigger issue though because I'm sure "visit" is assume all over the place.

Rather than diverting through astropy Table to get the masked
array, convert to Arrow Table and use Eli Rykoff's conversion
code in daf_butler to generate the masked array directly.
@timj timj marked this pull request as ready for review September 30, 2024 23:34
Copy link
Contributor

@andy-slac andy-slac left a comment

Choose a reason for hiding this comment

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

Looks great, few minor comments.

python/lsst/dax/obscore/cli/cmd/commands.py Outdated Show resolved Hide resolved
python/lsst/dax/obscore/cli/cmd/commands.py Outdated Show resolved Hide resolved
python/lsst/dax/obscore/config.py Show resolved Hide resolved
python/lsst/dax/obscore/obscore_exporter.py Outdated Show resolved Hide resolved
python/lsst/dax/obscore/obscore_exporter.py Outdated Show resolved Hide resolved
python/lsst/dax/obscore/siav2.py Show resolved Hide resolved

Returns
-------
info : `dict` [ `str`, `typing.Any` ]
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe make a simple dataclass or NamedTuple for this return type to make it type-safer?

Copy link
Member Author

Choose a reason for hiding this comment

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

The contents are universe-dependent. In our case we are returning a dict of filters and bands that match the query parameters. SphereX won't be returning that though since they don't have physical filters in their data model. I suppose a could define an empty BandInfo model and then return a subclass in this method but that wouldn't really help with the type safety problem since "filters" and "bands" would be properties of the subclass.

region = regions[0]
if len(regions) > 1:
for r in regions[1:]:
region = UnionRegion(region, r)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice if UnionRegion could take any number of regions in its constructor.

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed it would.

python/lsst/dax/obscore/siav2.py Outdated Show resolved Hide resolved
tests/test_siav2.py Outdated Show resolved Hide resolved
timj and others added 2 commits October 3, 2024 13:58
This is sometimes fine but when combining a where="" with
another where we were getting "x = y AND ()" which
is invalid. In this commit we trap and raise. Another option
is to ignore it when the combining happens.
@timj timj merged commit 5919c78 into main Oct 4, 2024
14 checks passed
@timj timj deleted the tickets/DM-45860 branch October 4, 2024 15:44
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.

4 participants