Skip to content

pip CASA updates#238

Merged
thomaswilliamsastro merged 4 commits intomasterfrom
tw_dev
Jun 14, 2023
Merged

pip CASA updates#238
thomaswilliamsastro merged 4 commits intomasterfrom
tw_dev

Conversation

@thomaswilliamsastro
Copy link
Copy Markdown
Collaborator

Some tidy-up to get the pipeline working in the latest pip-installed CASA environment. Retains backwards compatibility for earlier versions. Currently a draft until I've managed to chunk something through successfully, but I have got through imaging at least

  • Add ReleaseHandler to init.py
  • Various import fixes for newer python/CASA versions
  • uvcontsub -> uvcontsub_old for new CASA versions
  • Fix 'if' statements for == instead of 'is'
  • Remove deprecated np.float calls
  • Replace 'clobber' with 'overwrite' for hdu.writeto() calls if using astropy

Copy link
Copy Markdown
Collaborator

@low-sky low-sky left a comment

Choose a reason for hiding this comment

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

Provided version comparison works as intended, I think this is fine. However, I note that
'6.5.2' > '6.11.4' is True so I think strict string comparison isn't right here.



# TODO: For now, uvcontsub doesn't work as we want it in newer CASA versions, fall back to old version
if casa_version_str >= '6.5.2':
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does this work? I'd figure it would be something like:

from packaging import version
version.parse(casa_version_str) >= version.parse('6.5.2')

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

You're right, pushed this as an update. I've seen it just done in strings before so figured it'd be good, but I guess not

* Add ReleaseHandler to __init__.py
* Various import fixes for newer python/CASA versions
* uvcontsub -> uvcontsub_old for new CASA versions
* Fix 'if' statements for == instead of 'is'
* Remove deprecated np.float calls
* Replace 'clobber' with 'overwrite' for hdu.writeto() calls if using astropy

* Fix version string comparison in casaStuff.py
* np.int -> int
* np.bool -> bool
* Reduce decimation factor for small cubes in ccr.align_to_target
@thomaswilliamsastro
Copy link
Copy Markdown
Collaborator Author

I'll note here that the releaseHandler stuff needs some more heavy-duty refactoring, since it's calling keyHandler functions that no longer exist. I've managed to at least sort the other package deprecations but that would need to be another PR

@thomaswilliamsastro thomaswilliamsastro marked this pull request as ready for review June 12, 2023 22:31
@thomaswilliamsastro thomaswilliamsastro merged commit 1b4eac2 into master Jun 14, 2023
@thomaswilliamsastro thomaswilliamsastro deleted the tw_dev branch June 14, 2023 12:51
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