Revised CalCat API
6 unresolved threads
6 unresolved threads
Compare changes
src/cal_tools/calcat_interface2.py
0 → 100644
+ 839
− 0
@ahmedk Did you happen to catch up the term commonly used within the DET group for these labels?
Are we planning to add the rest of the detectors here, or there is a plan to have it for some detectors first?
Edited by Karim Ahmed
I wonder if this method should throw a
TypeError
if it's not string (or any of the handled types). Also, do we want to define the string time formats supported by CalCat and check for it?We can probably avoid by pushing people towards
datetime
/date
, but I'm afraid of users passing some string wrongly understood by CalCat.@manettim Is there a single point in CalCat that interprets date strings?
I think it's this method in CalCat:
https://git.xfel.eu/ITDM/calibration_catalog/-/blob/develop/app/controllers/api/v2/base_controller.rb#L267-270
The method it's calling seems to allow quite a range of inputs: https://api.rubyonrails.org/classes/ActiveSupport/TimeZone.html#method-i-parse . It's probably not practical to precisely replicate its rules in Python, though we could apply stricter rules.
Rejecting anything besides strings and datetime objects is a good idea, though.
That's correct!
We can implement strict rules on the format if you wish.