Skip to content
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

Add external scaffold to/from json and hdf5 #910

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jaclark5
Copy link

Description

This module will allow users to write and read a json file that can be reformed into an initial dataset before submission. This means that records are not present.

Status

  • Code base linted
  • Ready to go

ds = client.add_dataset(**ds_dict["metadata"])

for _, entry in ds_dict["entries"].items():
ds.add_entry(**entry)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kind of surprised this works. I guess it's just from keeping names consistent :)

It would be safer (and faster?) to build entry object(s) and use ds.add_entries(obj_list).

Every dataset has it's own entry type, but you can get it with ds._entry_type. So this might work (going from memory)

entry_type = ds._entry_type
....
new_entry = entry_type(**entry)

I think specifications will be ok to do your current way, though. Those are consistent across dataset types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants