Closed moustakas closed 7 months ago
Update: I'm running a mini-prod on this, but my first attempt failed due to unmasked raw data problems in my test sample which we previously were more robust to for reasons completely unrelated to this PR. I'm working on constructing a different mini-prod now.
The mini-prod caught one more resources
typo, which is now fixed.
For the record, a resources.files
problem/challenge that I have encountered in the past is that it returns a PosixPath
which acts similar to a str
but isn't a strict superset of functionality, so things like filename.replace('.fits', '.csv') don't work. But I didn't find any cases of that kind of problem here, so this looks good. Thanks for the updates, merging now.
This is a cleanup PR which should fix #2018. It touches a lot of files but the changes are relatively minimal.
Note that a few modules imported
pkg_resources.resource_filename
but didn't actually use it, so I removed that import entirely. Also, I replacedpkg_resources.resource_exists()
withimportlib.resources.files('desispec').joinpath('desired_file_in_desispec').is_file()
, as recommended here.To find the impacted files, I did:
and then I also checked all the executable scripts in
desispec/bin/
.Hopefully I'm not missing any files but those can be cleaned up as needed in future PRs; this PR gets most of them (for
desispec
at least).Finally, I ran
pytest
at NERSC and I think everything passed, but I'm not sure how to interpret "2 xfailed" in the log, below (if this is something I introduced or if it's a known issue):