-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP stub out pandas roundtrip #289
WIP stub out pandas roundtrip #289
Conversation
Hi @MarcoGorelli that was fast! However, could you please make this pull request into the Development branch instead? We won't be tinkering around with this in Master for a while. |
ac85aff
to
1eb256b
Compare
sure, have rebased! |
Thanks! Waiting for Pytest to complete and I'll merge. Question: are there tests for these new functionalities? |
@MarcoGorelli one issue is that Pyleoclim currently uses pandas 1.5.2, so I'm not sure if the non-ns datetime stuff will work yet. Do you need us to up the required version of pandas? |
Might be a bit early to merge, I was hoping to get feedback first on whether this is what you wanted - in particular on the A question I have is that it's currently possible to initialise a Regarding tests - I haven't added them just yet, I just wanted to make sure we were aligned on requirements / functionality first And re-pandas version - yeah you'll require the nightly build for this to work. Or just wait until version 2.0.0 to come out (should be some time in February), and in the meantime this could just live in some separate branch whilst it's being refined |
Oh, then I needs to go into the new-objects branch, which is where we're working on retooling everything and working on Pandas compatibility. This branch can have changes regarding its requirements (i.e., Pandas) or a new environment file so we get the nightly updates without affecting any of our other in-progress work. |
1eb256b
to
debbd5e
Compare
ah, nice - sure, done! |
Hi @khider - just for my understanding, was it your intention to merge this so you can try it out, and then (once you've tried it out) to provide feedback? |
Yes. I probably will work on this on Friday. I'm traveling tomorrow. But maybe @CommonClimate can give it a try too? |
I won't have time before Friday, but I can play with that after my class is done at 10 |
@MarcoGorelli a couple of thoughts occurred to me yesterday:
|
pandas only supports resolutions 's', 'ms', 'us', and 'ns' - 's' should be enough for any date you need to represent Regarding getting the datum / exponent / direction from time unit - sure, do you want to open a PR to fix that? It should just be a matter of changing the rules in Pyleoclim_util/pyleoclim/utils/tsutils.py Lines 51 to 83 in bed3d06
|
Just to precise with terminology here - |
OK. So, to confirm, we're just using plain pandas now, not the Re: Pyleoclim, I'm going through the code now to try and understand what you did. Please bear with me lowly domain scientist with no CS background.
Why define this as a property of the Series class rather than a method? Because it takes no argument? What if it used Also, you mention |
Yes, that's right, if this is more aligned with what you want then let's axe paleopandas
It doesn't have to be a property, it would just be analogous to how you call
It's there, and was added in this PR: Pyleoclim_util/pyleoclim/utils/tsutils.py Lines 51 to 83 in feae2d7
Perhaps you need to do a |
I'm talking about the reverse function: generating |
ah - I haven't written that one, and don't think it would be necessary (indeed, I don't think the mapping would be 1-1?) |
As discussed with @CommonClimate and @khider
The functions that still need populating are:
I think this should be possible using the conversion rules defined by @CommonClimate :