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

ParticleSpecies: Read to pandas.DataFrame #923

Merged
merged 2 commits into from
Feb 14, 2021
Merged

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Feb 5, 2021

Add a method tha reads a particle species into a pandas.DataFrame.

To Do

src/ParticleSpecies.cpp Outdated Show resolved Hide resolved
@ax3l ax3l force-pushed the topic-pandas branch 5 times, most recently from 04928c6 to 1a6bb81 Compare February 5, 2021 19:01
@ax3l ax3l changed the title [Draft] Pandas [Draft] ParticleSpecies: Convert to pandas.DataFrame Feb 5, 2021
@ax3l ax3l changed the title [Draft] ParticleSpecies: Convert to pandas.DataFrame [Draft] ParticleSpecies: Read to pandas.DataFrame Feb 5, 2021
found_pandas = False


def particles_to_dataframe(particle_species, slice=None):
Copy link
Member Author

Choose a reason for hiding this comment

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

Potential extra arguments:

  • records = iterable: a list of strings or regex expressions to load only specific records of the species
  • maybe an inverse parameter to deselect specific records from loading

Copy link
Contributor

@dmitry-ganyushin dmitry-ganyushin left a comment

Choose a reason for hiding this comment

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

Ok as a frist version, but see comments.

src/binding/python/openpmd_api/DataFrame.py Outdated Show resolved Hide resolved
examples/11_particle_dataframe.py Outdated Show resolved Hide resolved
particle_species.series_flush()
columns[column_name] *= rc.unit_SI

return pd.DataFrame(columns)
Copy link
Contributor

Choose a reason for hiding this comment

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

How large are particle species data? It looks like panda lib has capability to work with tables not fitting into memory.

Copy link
Member Author

@ax3l ax3l Feb 6, 2021

Choose a reason for hiding this comment

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

Particle data can be anything between 0 and 1e13 as of today.

Can you point me to information on how to handle out-of-core data in pandas?

@ax3l ax3l force-pushed the topic-pandas branch 2 times, most recently from 1f3ce13 to 32c0cba Compare February 11, 2021 00:58
@lgtm-com

This comment has been minimized.

@ax3l ax3l changed the title [Draft] ParticleSpecies: Read to pandas.DataFrame ParticleSpecies: Read to pandas.DataFrame Feb 11, 2021
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Feb 11, 2021

This pull request introduces 1 alert when merging 98ce484 into d97adf8 - view on LGTM.com

new alerts:

  • 1 for Unused import

Add a method tha reads a particle species into a
`pandas.DataFrame`.
@ax3l ax3l merged commit 7d30ee9 into openPMD:dev Feb 14, 2021
@ax3l ax3l deleted the topic-pandas branch February 14, 2021 23:16
@ax3l ax3l mentioned this pull request Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: new additions to the API frontend: Python3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants