About
This repository is split into two main tools: the compound database and property package builder.
Installation
To install this:
pip install ahuora-compounds
To install the development version, after cloning this repo:
pip install -e .
To use
Compound Database
Usage
Property Packages
from ahuora_property_packages.build_package import build_package
build_package("helmholtz",["h2o"],["vap","liq"])
Compounds
from ahuora_compounds.CompoundDB import db
db.search_compounds("ane")
> ["octane", "hexane", "..."]
db.get_compound_names()
> ["amonia", "benzene", "carbon dioxide", "..."]
db.get_compound(name)
> <Compound Object>
db.get_supported_packages(["benzene", "toluene", "..."])
> ["peng-robinson", "helmholtz"]
db.get_supported_compounds(["peng-robinson", "helmholtz"])
> ["benzene", "toluene", "..."]
Development
Creating new data loader under compounds/loaders/
3 step process
1 - register package
2 - register compounds
3 - bind compounds to package
# general workflow
# default property package
@loader("example_loader")
def load(registry):
registry.register_package(DefaultPropertyPackage("example_pp"))
registry.register_compound('compound1', "example_pp", {})
registry.register_compound('compound2', "example_pp", {})
registry.bind("compound1", "example_pp")
registry.bind("compound2", "example_pp")
# custom property package
class MilkPropertyPackage(PropertyPackage):
def check_supported_compound(self, compound: str, strict: bool = True) -> bool:
return True
@loader("example_loader")
def load(registry):
registry.register_package(MilkPropertyPackage("example_custom_pp"))
registry.register_compound('compound1', "example_custom_pp", {})
registry.register_compound('compound2', "example_custom_pp", {})
registry.register_compound('compound3', "example_custom_pp", {})
# Generates based on PropertyPackage check_supported_compound implementation
# In this case all compounds across loaders will be valid for this property package
registry.dynamic_bind("example_custom_pp")
more examples in compounds/loaders/
Deprecated methods
> get_compound(name)
[!WARNING] method is deprecated
# example usage
from CompoundDB import get_compound
benzene = get_compound("benzene")
benzene["AbsEntropy"].value # "269300"
benzene["AbsEntropy"].unit # "J/kmol/K"
> get_compound_names
[!WARNING] method is deprecated
# example usage
from CompoundDB import get_compound_names
names = get_compound_names()
print(names)
> ["benzene", "methane", "butane", "..."]
> search_compounds(query)
[!WARNING] method is deprecated
# example usage
from compounds import search_compounds
names = search_compounds("hex")
print(names)
> ["hexane", "1-hexane", "..."]
Property Package Builder
Usage
import property_packages
property_packages.build_package("helmholtz",["h2o"])
# Returns IDAES compatible ParameterBlock
Next Steps
Implement something to translate between apis, e.g for if the user specifies in Temperature and mass flow but the property package uses flow_mol and enthalpy
Publishing
When a commit to main is merged, the publish.yml action will automatically bump the patch version, commit the bumped version to main, build the package, and submit to pypi.
If you want to create a minor or major version, run
uv run hatch version minor
uv run hatch version major
and that will bump the major or minor version and you can commit that.
Metadata
Release files for ahuora-compounds 0.0.35
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ahuora_compounds-0.0.35.tar.gz | 687.2 kB | Without provenance | Details for ahuora_compounds-0.0.35.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ahuora_compounds-0.0.35-py3-none-any.whl | Python 3 | none | any | Details for ahuora_compounds-0.0.35-py3-none-any.whl |
Total release size: 2.1 MB
Release files / ahuora_compounds-0.0.35.tar.gz
| Download URL | ahuora_compounds-0.0.35.tar.gz |
|---|---|
| Size | 687.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a6cc229c369b657b24e78232323283d614e847c63f7e2f26fe5f010cbf61fd7
|
|
BLAKE2b-256 checksum How to use checksums |
8a393a483add80018d60dc478f3da00b5cf82e545fb4788146552cde4e1c54b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ahuora_compounds-0.0.35-py3-none-any.whl
| Download URL | ahuora_compounds-0.0.35-py3-none-any.whl |
|---|---|
| Size | 1.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ae932f6551828147f2fe9e7a8e40aa2f2dc914e3f8d36c22423edc39c849b783
|
|
BLAKE2b-256 checksum How to use checksums |
8fdb7ef7411e5684901ec67b2471dcfb40c1032e70e7ffb7f801e5d56717b3c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for ahuora-compounds 0.0.35
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.