Package: gamry-parser
gamry-parserPython package for parsing the contents of Gamry EXPLAIN data (DTA) files. This package is meant to convert flat-file EXPLAIN data into pandas DataFrames for easy analysis and visualization.Getting StartedDependenciespandasInstallationPackage from PyPi$pipinstallgamry-parserLocal InstallationCheck out the latest code:$gitclonegit@github.com:bcliang/gamry-parser.gitUse setuptools to install the package$pythonsetup.pyinstallUsageThe provided Usage example loads a CV DTA file two ways, and demonstrates the utility of custom functions within the CyclicVoltammetry subclass (get_v_range,get_scan_rate)$pythonusage.pyGamryParser ExampleThe following snippet loads a DTA file and prints to screen: (1) experiment type, (2) # of curves, and (3) a random curve in the form of a pandas DataFrame.importgamry_parserasparserimportrandomfile='/enter/the/file/path.dta'gp=parser.GamryParser()gp.load(filename=file)print("experiment type:{}".format(gp.get_experiment_type()))print("loaded curves:{}".format(gp.get_curve_count()))curve_index=random.randint(1,gp.get_curve_count())print("showing curve #{}".format(curve_index))print(gp.get_curve_data(curve_index))ChronoAmperometry ExampleTheChronoAmperometryclass is a subclass ofGamryParser. Executing the methodget_curve_data()will return a DataFrame with three columns: (1)T, (2)Vf, and (3)ImIn the example, the file is expected to be a simple chronoamperometry experiment (single step, no preconditioning); there will only be a single curve of data contained within the file. In addition, note the use of theto_timestampproperty, which allows the user to requestget_curve_datato return a DataFrame with aTcolumn containing DateTime objects (as opposed to the default: float seconds since start).importgamry_parserasparserimportrandomfile='/enter/the/file/path.dta'ca=parser.ChronoAmperometry(to_timestamp=True)ca.load(filename=file)print(ca.get_curve_data())DemosA simple demonstration is provided inusage.py.python usage.pyipython notebook demonstration scripts are included in thedemofolder.notebook_gamry_parser.ipynb: Simple example loading data from ChronoA experiment output. Instead ofgamry_parser.GamryParser(), the parser could be instantiated withgamry_parser.ChronoAmperometry()notebook_cyclicvoltammetry.ipynb: Example loading data from a CV (cyclic voltammetry) experiment output. Uses thegamry_parser.CyclicVoltammetry()subclass.notebook_cyclicvoltammetry_peakdetect.ipynb: Another example that demonstrates loading CV data and detecting peaks in the data usingscipy.signal.find_peaks()notebook_potentiostatic_eis.ipynb: Example loading data from an EIS (electrochemical impedance spectroscopy) experiment. Uses thegamry_parser.Impedance()subclass.Additional ExamplesSimilar procedure should be followed for using thegamry_parser.CyclicVoltammetry(),gamry_parser.Impedance(),gamry_parser.OpenCircuitPotential(), andgamry_parser.VFP600()parser subclasses. Take a look atusage.pyand intests/for some additional usage examples.DevelopmentProject Tree.
  ├── gamry_parser              # source files
  │   ├── ...          
  │   ├── chronoa.py            # ChronoAmperometry() experiment parser
  │   ├── cv.py                 # CyclicVoltammetry() experiment parser
  │   ├── eispot.py             # Impedance() experiment parser
  |   ├── gamryparser.py        # GamryParser: generic DTA file parser
  │   ├── ocp.py                # OpenCircuitPotential() experiment parser
  |   └── vfp600.py             # VFP600() parses experiment data generated by the Gamry VFP600 LabView Frontend. 
  ├── tests                     # unit tests and test data
  |   └── ...
  ├── setup.py                  # setuptools configuration
  └── ...RoadmapDocumentation! Loading of data is straightforward, and hopefully the examples provided in this README provide enough context for any of the subclasses to be used/extended.In the future, it would be nice to add support for things like equivalent circuit modeling, though at the moment there are other projects focused specifically on building out models and fitting EIS data (e.g.kbknudsen/PyEIS,ECSHackWeek/impedance.py).ChangelogSeeCHANGELOGTestsTests extendingunittest.TestCasemay be found in/tests/.Unit tests are triggered as part of every pull request, but users can run tests locally as well:$toxAlternatively, runpytestfrom your virtualenv (use the-kflag to filter tests)$pytest
$pytest-v-k"test_getters"Code GuidelinesGitHub flowfor proposing changes (i.e. create a feature branch and submit a PR against the master branch).Coding style: Pycodestyle formatting (PEP8). Linting viablackis run on each push to github.Tests: maintain > 90% line coverage, per fileVersioningSemVerfor versioning.Matching major version numbers are guaranteed to work together.Any change to the public API (breaking change) will increase a major version.PublishingThe package relies on Github Actions to automatically build and upload artifacts to pypi upon published release.Manual publishing (deprecated)Use setuptools to build, twine to publish to pypi.$rm-rfdist
$pythonsetup.pybuild
$pythonsetup.pysdistbdist_wheel
$twineuploaddist/*LicenseThis project is licensed under the MIT License - see theLICENSEfile for details