labscript-suite-temp / lyse

lyse is an analysis framework. It coordinates the running of python analysis scripts on experiment data as it becomes availiable, updating plots in real time.
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Replace convert_objects #34

Open philipstarkey opened 7 years ago

philipstarkey commented 7 years ago

Original report (archived issue) by Jan Werkmann (Bitbucket: PhyNerd, GitHub: PhyNerd).


There is a deprecation warning that lyse currently throws the first time the dataframe is requested by a analysis routine.

#!python

WARNING lyse: /Users/janwerkmann/labscript_suite/lyse/__main__.py:174: FutureWarning: convert_objects is deprecated.  Use the data-type specific converters pd.to_datetime, pd.to_timedelta and pd.to_numeric.
  convert_dates=False, convert_numeric=False, convert_timedeltas=False)

We should maybe replace it?

philipstarkey commented 7 years ago

Original comment by Philip Starkey (Bitbucket: pstarkey, GitHub: pstarkey).


Hmm, this looks messy. There's a discussion here about the deprecation. There is now a infer_objects method in pandas, but I don't think that directly replicates what we currently do (I think it will probably convert dates and timedeltas - see the source code for that vs convert_objects).

There is also a _convert method we could use, but that's a little dodgy since it's not part of the exposed API.