Skip to content

Commit

Permalink
ready for release
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrille Lavigne committed Apr 15, 2021
1 parent f6dcd1d commit 6c690db
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 4 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@ To use it, simply point it at a file and give it a deck to load, like so:
import fchic

with open("data.fchk", "r") as f:
out = fchic.deck_load(f, "Cartesian Force Constants")
out = fchic.deck_load(f, "Cartesian Gradient")
```

`out` is now a list of `3 x N` floating point numbers parsed from the
`Cartesian Gradient` section of `data.fchk`.

**Note:** fchic does no data validation (beyond shape and type), no physical
unit conversions and no integration into fancy data structures. It is entirely
a single page, simple [pyparsing](https://github.com/pyparsing/pyparsing/)
grammar. You'll need to do your own data processing from its outputs.


## Documentation
## Usage

fchic consists of four functions:

Expand All @@ -38,6 +41,12 @@ Python is not exactly fast, and neither is pyparsing, so you'll generally want
to use `fchic.deck_load()` which does not have to parse the whole file, and is
therefore way way 🐇 faster 🐇.

## Installation

```bash
pip install fchic
```

## License

fchic is provided under the MIT license.
Expand Down
31 changes: 29 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,46 @@
"""Install fchic."""
import setuptools
from os import path

# read the contents of your README file
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
long_description = f.read()


setuptools.setup(
name="fchic",
version="0.1.0",
author="Cyrille Lavigne",
author_email="[email protected]",
description="",
url="https://github.com/aspuru-guzik-group/fchic",
description="fchic is a minimal parser for Gaussian 16 formatted checkpoint files.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/clavigne/fchic",
package_dir={"": "src"},
package_data={"fchic": ["py.typed"]}, # mypy exports
packages=setuptools.find_namespace_packages(where="src"),
license="MIT",
# Dependencies
python_requires=">=3.7",
install_requires=[
"pyparsing",
'importlib-metadata ~= 1.0 ; python_version < "3.8"',
],
classifiers=[
"Development Status :: 3 - Alpha",
#
"Typing :: Typed",
#
"License :: OSI Approved :: MIT License",
#
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
#
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Chemistry",
"Topic :: Scientific/Engineering :: Physics",
],
keywords="chemistry gaussian16 g16",
)
16 changes: 16 additions & 0 deletions src/fchic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,19 @@ def deck_load(inp: TextIO, name: str) -> Deck:
if my_name.strip() != name.strip():
raise RuntimeWarning(f"expected deck {name}, but got a deck named {my_name}")
return _to_deck(group)


# Version information
# We grab it from setup.py so that we don't have to bump versions in multiple
# places.
try:
# std
from importlib import metadata

__version__ = metadata.version("fchic")
except ImportError:
# Running on pre-3.8 Python; use importlib-metadata package
# external
import importlib_metadata

__version__ = importlib_metadata.version("fchic")

0 comments on commit 6c690db

Please sign in to comment.