LinkedEarth / pylipd

Development repository for Python LiPD utilities
https://pylipd.readthedocs.io/en/latest/
Apache License 2.0
2 stars 0 forks source link

Create a shorthand to merge two LiPD objects #36

Closed khider closed 1 year ago

khider commented 1 year ago

Let's say I have two LiPD objects D and D1

D.load('dataset1.lpd')
D1.load('dataset2.lpd')

Create a new objects D3 that combines D1 and D2, preferably the short hand should be:

D3= D & D1

varunratnakar commented 1 year ago

Just curious what's the use case for this ? Why couldn't we just do D.load two times ?

khider commented 1 year ago

I was thinking more as a merge once loaded. Here is a use case, let's say that I have one object that contains all the PAGES2k files and another the ISO2k so the databases are kept separate. Now let's say I want to merge them with some criteria. (e.g., filter all coral data from both and create a new object).

But I still retain my original object. I know you could do this with querying in a nifty way but pretty sure people will want a shortcut at some point. But not urgent...

khider commented 1 year ago

Done with merge but not working. See this notebook to reproduce.

varunratnakar commented 1 year ago

You have to capture the return value D_merged = D_parallel.merge(D)