tfs-pandas

Python package to handle TFS files

https://github.com/pylhc/tfs

Science Score: 59.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    4 of 8 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.1%) to scientific vocabulary

Keywords

cern mad-x pandas python read-write tfs tfs-pandas

Keywords from Contributors

omc optics particle-accelerators accelerator-physics frequency-analysis optics-measurements plots commandline-calls generic-parser ini-parser
Last synced: 6 months ago · JSON representation

Repository

Python package to handle TFS files

Basic Info
Statistics
  • Stars: 8
  • Watchers: 15
  • Forks: 4
  • Open Issues: 0
  • Releases: 33
Topics
cern mad-x pandas python read-write tfs tfs-pandas
Created about 7 years ago · Last pushed 7 months ago
Metadata Files
Readme Changelog License Zenodo

README.md

TFS-Pandas

Cron Testing Code Climate coverage Code Climate maintainability (percentage) <!-- GitHub last commit --> GitHub release PyPI Version Conda-forge Version DOI

This package provides reading and writing functionality for Table Format System (TFS) files. Files are read into a TfsDataFrame, a class built on top of the pandas.DataFrame, which in addition to the normal behavior attaches a dictionary of headers to the DataFrame.

See the API documentation for details.

Installing

Installation is easily done via pip:

bash python -m pip install tfs-pandas

One can also install in a conda/mamba environment via the conda-forge channel with:

bash conda install -c conda-forge tfs-pandas

Example Usage

The package is imported as tfs, and exports top-level functions for reading and writing:

```python import tfs

Loading a TFS file is simple

dataframe = tfs.read("pathtoinput.tfs", index="indexcolumn")

You can access and modify the headers with the .headers attribute

usefulvariable = dataframe.headers["SOMEKEY"] dataframe.headers["NEWKEY"] = somevariable

Manipulate data as you do with pandas DataFrames

dataframe["NEWCOL"] = dataframe.COLA * dataframe.COL_B

You can check the validity of a TfsDataFrame, speficying the

compatibility mode as well as the behavior in case of errors

tfs.frame.validate( dataframe, nonunique_behavior="raise", # or choose "warn" compatibility="mad-x", # or choose "mad-ng" )

Writing out to disk is simple too

tfs.write("pathtooutput.tfs", dataframe, saveindex="index_column") ```

Compression is automatically supported, based on the provided file extension (for supported formats):

```python import tfs

Reading a compressed file is simple, compression format is inferred

df = tfs.read("pathtoinput.tfs.gz")

When writing choose the compression format by providing the appropriate file extension

tfs.write("pathtooutput.tfs.bz2", df) tfs.write("pathtooutput.tfs.zip", df) ```

License

This project is licensed under the MIT License - see the LICENSE file for details.

Owner

  • Name: PyLHC
  • Login: pylhc
  • Kind: organization
  • Location: CERN

Organisation for the OMC Team at CERN, in BE-ABP-LNO.

GitHub Events

Total
  • Create event: 5
  • Issues event: 2
  • Release event: 2
  • Delete event: 3
  • Issue comment event: 9
  • Push event: 99
  • Pull request event: 1
  • Pull request review event: 45
  • Pull request review comment event: 58
Last Year
  • Create event: 5
  • Issues event: 2
  • Release event: 2
  • Delete event: 3
  • Issue comment event: 9
  • Push event: 99
  • Pull request event: 1
  • Pull request review event: 45
  • Pull request review comment event: 58

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 77
  • Total Committers: 8
  • Avg Commits per committer: 9.625
  • Development Distribution Score (DDS): 0.558
Past Year
  • Commits: 16
  • Committers: 3
  • Avg Commits per committer: 5.333
  • Development Distribution Score (DDS): 0.375
Top Committers
Name Email Commits
Felix Soubelet 1****t@u****m 34
JoschD j****y@g****m 26
JoschD 2****D@u****m 7
Joschua Werner Dilly j****y@c****h 4
Felix Soubelet f****t@p****m 2
Mäel Le Garrec m****c@c****h 2
lmalina l****a@c****h 1
mihofer m****r@c****h 1
Committer Domains (Top 20 + Academic)
cern.ch: 4

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 47
  • Total pull requests: 67
  • Average time to close issues: 3 months
  • Average time to close pull requests: 15 days
  • Total issue authors: 6
  • Total pull request authors: 6
  • Average comments per issue: 1.15
  • Average comments per pull request: 1.09
  • Merged pull requests: 66
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 6
  • Average time to close issues: N/A
  • Average time to close pull requests: 14 days
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 2.33
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • JoschD (21)
  • fsoubelet (16)
  • lmalina (6)
  • rdemaria (2)
  • mihofer (1)
  • st-walker (1)
Pull Request Authors
  • fsoubelet (50)
  • JoschD (19)
  • Mael-Le-Garrec (2)
  • fscarlier (2)
  • lmalina (1)
  • st-walker (1)
Top Labels
Issue Labels
Enhancement (23) Bug (16) Minor (9) Feature Request (6) To be discussed (5) Question (3) Major (2) Type: Feature (2) Status: In Progress (2) Documentation (1) Type: Release (1) Estimate: Complicated (1) Priority: High (1) Type: Documentation (1) Priority: Medium (1) Estimate: Normal (1)
Pull Request Labels
Enhancement (30) Minor (20) Bug (12) Feature Request (8) CI/CD (7) To be discussed (7) Documentation (5) Status: Review Needed (3) Type: Release (3) Type: Feature (3) Major (2) Type: Documentation (2) Type: Maintenance (2) Priority: High (2) Type: CI/CD (1) Priority: Low (1) Estimate: Easy (1)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 3,870 last-month
  • Total dependent packages: 12
    (may contain duplicates)
  • Total dependent repositories: 4
    (may contain duplicates)
  • Total versions: 38
  • Total maintainers: 1
pypi.org: tfs-pandas

Read and write tfs files.

  • Versions: 34
  • Dependent Packages: 9
  • Dependent Repositories: 3
  • Downloads: 3,870 Last month
  • Docker Downloads: 0
Rankings
Dependent packages count: 1.0%
Downloads: 3.6%
Docker downloads count: 4.6%
Average: 8.4%
Dependent repos count: 8.9%
Forks count: 14.2%
Stargazers count: 17.7%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: tfs-pandas

A wrapper around pandas DataFrames to handle TFS files.

  • Versions: 4
  • Dependent Packages: 3
  • Dependent Repositories: 1
Rankings
Dependent packages count: 15.6%
Dependent repos count: 24.4%
Average: 37.7%
Forks count: 54.2%
Stargazers count: 56.6%
Last synced: 6 months ago

Dependencies

.github/workflows/coverage.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/cron.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/documentation.yml actions
  • JamesIves/github-pages-deploy-action 3.7.1 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/publish.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/tests.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite