Fix numpy str FutureWarning and modernize get_ifot slightly #321
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This fixes a FutureWarning caused by using
np.str
. The code got much cleaner due to an improvement inio.ascii
since this kadi code was written. Now theconverters
kwarg can just be a dict of types (exactly the same as thetypes
kwarg here). See https://docs.astropy.org/en/stable/io/ascii/read.html#parameters-for-read.In addition I added a docstring and removed mutable values as keyword defaults in
get_ifot
.Fixes #320
Interface impacts
The
types
dict option ofget_ifot
now requires that the type be specified as the actual type object (e.g.str
ornp.int64
) instead of astr
that is used ingetattr(np, type)
.I searched the
sot
repo on GitHub and found no instances outside of kadi that used thetypes
kwarg ofget_ifot
.Testing
Unit tests
I don't have a
speedy
environment handy but that might be a good thing for the reviewer to test.Independent check of unit tests by [REVIEWER NAME]
Functional tests
I ran the
kadi_update_events
script locally in current ska3-flight and confirmed that it ran successfully. I also confirmed that it fails without the fix changing"str"
tostr
inmodels.py
.