-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add pyradiosky version to output file #384
Conversation
Codecov Report
@@ Coverage Diff @@
## main #384 +/- ##
==========================================
+ Coverage 99.17% 99.32% +0.15%
==========================================
Files 13 13
Lines 2054 2068 +14
==========================================
+ Hits 2037 2054 +17
+ Misses 17 14 -3
Continue to review full report at Codecov.
|
@steven-murray We added this to the same place where we add the pyuvsim and pyuvdata version info in |
@bhazelton the reason we use Most other simulators don't have a function that will directly run from the config file, which makes it necessary for hera_sim to provide this layer. Note that |
Ok, then I think we need to move the history modifications so that they get picked up by both functions. |
so the history is set if that function is called directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do have one comment that could be addressed, but approving because it's small and you might not agree. Thanks @bhazelton!
pyuvsim/simsetup.py
Outdated
# If the filename parameter doesn't exist on the sky object | ||
# (because of an older version of pyradiosky) or if it is None (e.g. for mock skies) | ||
# add the source_list_name to the object so it can be put in the UVData history later | ||
if not hasattr(sky, "filename") or sky.filename is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be written if not getattr(sky, "filename", None):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion, I actually needed getattr(sky, "filename", None) is None:
.
per PR review comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good.
Description
run_uvdata_uvsim
function so it will be set if that function is called directly (as it is inhera_sim
).Note: In order to have all the required info in
run_uvdata_uvsim
for the history, I needed to add some attributes to SkyModelData. I also needed to add the input catalog filename to the SkyModel object created insimsetup.initialize_catalog_from_params
. For the current and older versions of pyradiosky, this will be a simple attribute. But I also made a PR on pyradiosky to add a filename attribute more generally (see RadioAstronomySoftwareGroup/pyradiosky#169). The implementation in this PR works with both the current pyradiosky and with the branch in that PR.Motivation and Context
fixes #327
Types of changes
Checklist:
For all pull requests:
New feature checklist: