Skip to content

Commit

Permalink
Expose missing parameter records to Python (#252)
Browse files Browse the repository at this point in the history
* added missing Python records for binary parameters

* Add binary records to docs.

* Added some docstrings
  • Loading branch information
g-bauer committed Jun 19, 2024
1 parent 843739c commit 4f0993c
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/api/pets.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
Identifier
IdentifierOption
ChemicalRecord
PureRecord
BinaryRecord
PetsBinaryRecord
PetsRecord
PetsParameters
```
```
3 changes: 2 additions & 1 deletion docs/api/saftvrqmie.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ parameters = SaftVRQMieParameters.from_json(['hydrogen', 'neon'], 'parameters.js
PureRecord
BinaryRecord
SaftVRQMieRecord
SaftVRQMieBinaryRecord
SaftVRQMieParameters
```
```
4 changes: 2 additions & 2 deletions docs/api/uvtheory.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ parameters = UVTheoryParameters.from_json(['methane', 'ethane'], 'parameters.jso
Identifier
IdentifierOption
ChemicalRecord
PureRecord
BinaryRecord
Perturbation
UVTheoryRecord
UVTheoryBinaryRecord
UVTheoryParameters
```
```
1 change: 1 addition & 0 deletions src/pcsaft/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ impl_json_handling!(PyPcSaftRecord);
impl_pure_record!(PcSaftRecord, PyPcSaftRecord);
impl_segment_record!(PcSaftRecord, PyPcSaftRecord);

/// Create a record for a binary interaction parameter.
#[pyclass(name = "PcSaftBinaryRecord")]
#[derive(Clone)]
pub struct PyPcSaftBinaryRecord(PcSaftBinaryRecord);
Expand Down
3 changes: 2 additions & 1 deletion src/pets/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ impl PyPetsRecord {
impl_json_handling!(PyPetsRecord);
impl_pure_record!(PetsRecord, PyPetsRecord);

/// Create a record for a binary interaction parameter, i.e. k_ij.
#[pyclass(name = "PetsBinaryRecord")]
#[derive(Clone)]
pub struct PyPetsBinaryRecord(PetsBinaryRecord);
Expand Down Expand Up @@ -242,9 +243,9 @@ impl_parameter!(
pub fn pets(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_class::<PyIdentifier>()?;
m.add_class::<IdentifierOption>()?;
m.add_class::<PyChemicalRecord>()?;

m.add_class::<PyPetsRecord>()?;
m.add_class::<PyPetsBinaryRecord>()?;
m.add_class::<PyPureRecord>()?;
m.add_class::<PyBinaryRecord>()?;
m.add_class::<PyPetsParameters>()?;
Expand Down
1 change: 1 addition & 0 deletions src/saftvrmie/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ impl PySaftVRMieRecord {
impl_json_handling!(PySaftVRMieRecord);
impl_pure_record!(SaftVRMieRecord, PySaftVRMieRecord);

/// Create a record for a binary interaction parameter.
#[pyclass(name = "SaftVRMieBinaryRecord")]
#[derive(Clone)]
pub struct PySaftVRMieBinaryRecord(SaftVRMieBinaryRecord);
Expand Down
1 change: 1 addition & 0 deletions src/saftvrqmie/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ pub fn saftvrqmie(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_class::<FeynmanHibbsOrder>()?;

m.add_class::<PySaftVRQMieRecord>()?;
m.add_class::<PySaftVRQMieBinaryRecord>()?;
m.add_class::<PyPureRecord>()?;
m.add_class::<PyBinaryRecord>()?;
m.add_class::<PySaftVRQMieParameters>()?;
Expand Down
2 changes: 1 addition & 1 deletion src/uvtheory/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ impl_parameter!(
pub fn uvtheory(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_class::<PyIdentifier>()?;
m.add_class::<IdentifierOption>()?;
m.add_class::<PyChemicalRecord>()?;

m.add_class::<Perturbation>()?;
m.add_class::<PyUVTheoryRecord>()?;
m.add_class::<PyUVTheoryBinaryRecord>()?;
m.add_class::<PyPureRecord>()?;
m.add_class::<PyBinaryRecord>()?;
m.add_class::<PyUVTheoryParameters>()?;
Expand Down

0 comments on commit 4f0993c

Please sign in to comment.