PAHFIT / pahfit

Model Decomposition for Near- to Mid-Infrared Spectroscopy of Astronomical Sources
https://pahfit.readthedocs.io/
18 stars 26 forks source link

features.loc[feature_name] not working consistently #286

Open drvdputt opened 2 months ago

drvdputt commented 2 months ago

We build an index for a Features table, so that rows can be accessed by the feature name. In certain contexts, this index is no longer available, so .loc will throw ValueError: Can only use TableLoc for a table with indices.

Findings so far

So it could be the astropy version (6.1.0 vs 6.0.1?), or the python version (behavior of deepcopy between 3.9 vs 3.10 vs 3.11?). The workaround, is to avoid the use of loc in the code, and just use the filter features['name'] == feature_name instead. On the user end, things seem mostly fine, so we can still support .loc there.

jdtsmith commented 2 months ago

The user can edit/add/change priority for loc too so probably safer for us not to rely on it.