Hansen Solubility Parameters in Python
Project description
Hansen Solubility Parameters in Python.
Introduction
HSPiPy is a Python library designed for calculating and visualizing Hansen Solubility Parameters (HSP). The library provides tools to compute HSP from a grid of solvent data and offers 2D and 3D plotting capabilities to visualize the solubility parameter space
Installation
Install HSPiPy easily with pip:
pip install HSPiPy
Usage
Reading HSP Data
To read HSP data from a CSV file, create an instance of the HSP class and use the read method:
from HSPiPy import HSP
hsp = HSP()
hsp.read('path_to_your_hsp_file.csv')
Calculating HSP
Use the get method to calculate the Hansen Solubility Parameters (HSP) from your data:
hsp.get()
Visualizing HSP
Use the plot_3d and plot_2d methods to visualize the HSP data in 3D and 2D formats, respectively:
hsp.plot_3d()
hsp.plot_2d()
HSP class methods:
Method |
Description |
---|---|
read(path) |
Reads solvent data from a CSV file. |
get(inside_limit=1) |
Calculates the HSP and identifies solvents inside and outside the solubility sphere. |
plot_3d() |
Plots the HSP data in 3D. |
plot_2d() |
Plots the HSP data in 2D. |
plots() |
Generates both 2D and 3D plots. |
Once you have calculated the HSP parameters using the get() method, you can access the calculated HSP parameters and related attributes through the properties of the HSP class instance. Below are the attributes you can access:
Attribute | Description |
|
---|---|
hsp.d |
Float - Dispersion parameter of the HSP. |
hsp.p |
Float - Polar parameter of the HSP. |
hsp.h |
Float - Hydrogen-bonding parameter of the HSP. |
hsp.radius |
Float - Radius of the solubility sphere. |
hsp.error |
Float - Error in the HSP calculation. |
hsp.inside |
Numpy array - Solvents inside the solubility sphere. |
hsp.outside |
Numpy array - Solvents outside the solubility sphere. |
hsp.outside |
A Pandas DataFrame containing the solvent data with columns for the solvent name, dispersion (D), polar (P), hydrogen-bonding (H), and score values. |
Contributing
Contributions are welcome! If you have any suggestions, feature requests, or bug reports, please open an issue on the GitHub repository.
License
This library is licensed under the MIT License. See the LICENSE file for details.
Acknowledgements
HSPiPy was inspired by the well-known HSP software suit Hansen Solubility Parameters in Practice (HSPiP) and by the HSP community.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file hspipy-0.3.tar.gz
.
File metadata
- Download URL: hspipy-0.3.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fd224248294804cbfaac8b1571cf9e3e085988d16f80689f8e05d1e044ade4e |
|
MD5 | 2b782aad11272940b789193bf1451ff5 |
|
BLAKE2b-256 | 72707f3de7eefff0acfc2641d8d9dff3d1316d0a398429510e30e54241116c78 |
File details
Details for the file HSPiPy-0.3-py3-none-any.whl
.
File metadata
- Download URL: HSPiPy-0.3-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6d8309df77498cbc4499c2ed5e4b584fcb1a19ca238ed5bbc3ff46a8d9bae92 |
|
MD5 | 05381e4d2701dc6eb8819b1d180e1051 |
|
BLAKE2b-256 | bb7c381ed9fbc20778697e0477d807f0a85e0272712b456740fe4c946957622b |