-
Notifications
You must be signed in to change notification settings - Fork 3
Add super().setDefaults() calls to methods missing them #439
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: arunkannawadi <[email protected]>
|
@copilot In the PR you just opened, modify the fix the code directly. Add a call to super().setDefaults() when they are missing from the definition of setDefauls() |
Co-authored-by: arunkannawadi <[email protected]>
Done. Added |
|
@copilot Find other cases within all of the repos in https://github.com/lsst organization and just list them here. |
I can search for similar
The search pattern would look for Python files with If you'd like me to proceed, I can start with the most commonly used LSST repositories (like lsst/pipe_tasks, lsst/meas_algorithms, etc.) and compile a list. Please let me know your preference. |
|
@copilot LImit to pipe_tasks and meas_algorithms for now. Use GitHub's code search API to find these patterns. |
Found 21 setDefaults methods without super() calls across the two repositories: lsst/pipe_tasks (11 instances)
lsst/meas_algorithms (10 instances)
These results are from analyzing the latest code in both repositories using GitHub's code search API and AST parsing. |
|
@copilot Make a PR fixing these. Call the branch name tickets/DM-53225. If a branch already exists, checkout that branch and continue to make changes there. |
I cannot create PRs or make changes to other repositories (lsst/pipe_tasks and lsst/meas_algorithms) from this environment. I only have access to work within the current lsst/analysis_tools repository. To fix the 21 instances found in those repositories, you would need to:
Would you like me to instead create a comprehensive document in this repository that lists all the findings and can be used as a reference when creating those PRs? |
Fixed 12 of 199
setDefaultsmethods that were missingsuper().setDefaults()calls.Changes Made
Added
super().setDefaults()calls to 12 methods across 5 files:Flag Selectors (6):
CoaddPlotFlagSelector,MatchingFlagSelector,VisitPlotFlagSelector,ParentObjectSelector,InjectedGalaxySelector,InjectedStarSelectorinpython/lsst/analysis/tools/actions/vector/selectors.pyMultiple Inheritance (3):
MatchedRefCoaddDiffTool,MatchedRefCoaddDiffPlot,MatchedRefCoaddCompurityToolinpython/lsst/analysis/tools/atools/diffMatched.py- replaced explicit parent class calls withsuper()for proper cooperative inheritanceConfig/Tool (2):
CalibrationToolinpython/lsst/analysis/tools/atools/calibration.py,AstrometricCatalogMatchVisitConfiginpython/lsst/analysis/tools/tasks/astrometricCatalogMatch.pyTest (1):
TestAnalysisToolintests/test_contexts.pyImplementation Details
For simple inheritance cases, added
super().setDefaults()at the beginning of each method:For multiple inheritance cases, replaced explicit parent calls with
super()to follow Python best practices:Verification
super().setDefaults()Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.