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-35681: ensure QuantumGraph is passed a DimensionUniverse at construction #265

Merged
merged 4 commits into from
Jul 23, 2022

Conversation

TallJimbo
Copy link
Member

@TallJimbo TallJimbo commented Jul 21, 2022

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@codecov
Copy link

Codecov bot commented Jul 21, 2022

Codecov Report

Merging #265 (51bde6a) into main (913bdc4) will decrease coverage by 0.10%.
The diff coverage is 41.66%.

❗ Current head 51bde6a differs from pull request most recent head 737f6b3. Consider uploading reports for the commit 737f6b3 to get more accurate results

@@            Coverage Diff             @@
##             main     #265      +/-   ##
==========================================
- Coverage   72.28%   72.17%   -0.11%     
==========================================
  Files          60       60              
  Lines        6772     6779       +7     
  Branches     1395     1399       +4     
==========================================
- Hits         4895     4893       -2     
- Misses       1654     1658       +4     
- Partials      223      228       +5     
Impacted Files Coverage Δ
...thon/lsst/pipe/base/graph/_versionDeserializers.py 62.91% <ø> (-0.84%) ⬇️
python/lsst/pipe/base/graph/graph.py 80.91% <22.22%> (-1.75%) ⬇️
python/lsst/pipe/base/graph/_loadHelpers.py 84.84% <100.00%> (+0.23%) ⬆️
python/lsst/pipe/base/graphBuilder.py 68.55% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 913bdc4...737f6b3. Read the comment docs.

@@ -173,6 +170,15 @@ def _buildGraphs(
# a newly created QuantumNode to the appropriate input/output
# field.
for quantum in quantumSet:
if quantum.dataId is not None:
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not really bothered by codecov's complaints here: I'm just being super defensive about trying to avoid backwards-compatibilty breakage by guessing the DimensionUniverse, but really everybody should be using the code path that is tested, in which the universe is passed explicitly (since that's what GraphBuilder).

Copy link
Contributor

@MichelleGower MichelleGower left a comment

Choose a reason for hiding this comment

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

Just a couple questions probably more for my info than anything about the code itself. I don't know all of this code so there may be some location that was missed. But I ran the pipe_base and bps unit tests which were all fine. Also I submitted a test run on the idf that had the warning before and now it doesn't. Merge approved.

newInst._buildGraphs(
quantumDict,
_quantumToNodeId={n.quantum: n.nodeId for n in nodes},
_buildId=self._buildId,
metadata=self._metadata,
universe=self._universe,
Copy link
Contributor

Choose a reason for hiding this comment

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

May be perfectly correct, but seems strange to create the object with the universe value on line 631 and then pass in the same value to that object's method on line 637.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree it's strange; it's an artifact of some hoops the code jumps through to avoid having the "usual" __init__ logic do a lot of unnecessary work. Basically, passing the universe to __init__ just saves __init__ from complaining that it doesn't have a universe, and then the next call actually sets up the graph (including setting the universe).

@@ -13,7 +13,7 @@ repos:
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.8
language_version: python3.10
Copy link
Contributor

Choose a reason for hiding this comment

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

The changes in this ticket required jumping to python 3.10?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it's just something that should have been done earlier that had gone unnoticed until now (I think it only matters when someone does pre-commit install).

This is not the Python version used to run black, and updating it to
3.10 does not break compatibility with 3.8; it just makes our
formatting more future-compatible (and as of right now, in this
package, it does nothing).
@TallJimbo TallJimbo merged commit e718c22 into main Jul 23, 2022
@TallJimbo TallJimbo deleted the tickets/DM-35681 branch July 23, 2022 16:11
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.

2 participants