Name | preservationeval JSON |
Version |
0.3.1
JSON |
| download |
home_page | None |
Summary | A Python implementation of the calculations and evaluations done by the Dew Point Calculator found at https://www.dpcalc.org/. |
upload_time | 2024-11-25 19:43:40 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.11 |
license | None |
keywords |
preservation
climate
numpy
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# preservationeval
[![PyPI](https://img.shields.io/pypi/v/preservationeval?style=flat&color=blue&label=pypi&logo=pypi)](https://pypi.org/project/preservationeval/)
[![Python](https://img.shields.io/pypi/pyversions/preservationeval?style=flat&color=blue&logo=python)](https://pypi.org/project/preservationeval/)
[![CI](https://img.shields.io/github/actions/workflow/status/petter-b/preservationeval/ci.yml?style=flat&label=CI&logo=github-actions&logoColor=white)](https://github.com/petter-b/preservationeval/actions/workflows/ci.yml)
[![Coverage](https://img.shields.io/codecov/c/github/petter-b/preservationeval?style=flat&color=brightgreen&label=coverage&logo=codecov)](https://codecov.io/gh/petter-b/preservationeval)
[![License](https://img.shields.io/badge/license-MIT-blue?style=flat&logo=opensourceinitiative&logoColor=white)](https://opensource.org/licenses/MIT)
A Python implementation of the calculations and evaluations done by the Dew Point Calculator found at https://www.dpcalc.org/.
## Details
The preservation evaluation is inspired by the [Dew point calulator](http://www.dpcalc.org) created by the Image Permanence Institute. They are publishing their code http://www.dpcalc.org/dp.js and most of the work in this project has been spent on figuring out how to install this package without redistributing the core lookup tables. These tables are downloaded from the Internet and converted into a python module during installation of the package.
## Installation
```bash
pip install preservationeval
```
## Usage
### Basic Examples
```python
from preservationeval import pi, emc, mold
# Calculate Preservation Index
pi_value = pi(20, 50) # temperature=20°C, RH=50%
print(f"Preservation Index: {pi_value}")
# Calculate EMC (Equilibrium Moisture Content)
emc_value = emc(20, 50)
print(f"EMC: {emc_value}%")
# Calculate Mold Risk
mold_risk = mold(20, 50)
print(f"Mold Risk: {mold_risk}")
```
### Interpreting Restults
For details of how to use, see:
- http://www.dpcalc.org/howtouse_step2.php
## Development
[![Project Status](https://img.shields.io/pypi/status/preservationeval?style=flat&color=blue&label=status&logo=pypi)](https://pypi.org/project/preservationeval/)
[![Downloads](https://img.shields.io/pepy/dt/preservationeval?style=flat&color=blue&logo=python&logoColor=white)](https://pepy.tech/project/preservationeval)
[![Issues](https://img.shields.io/github/issues/petter-b/preservationeval?style=flat&color=yellow&logo=github)](https://github.com/petter-b/preservationeval/issues/)
### Setup
```bash
# Clone the repository
git clone https://github.com/petter-b/preservationeval
cd preservationeval
# Install development dependencies
pip install -e ".[dev]"
```
### Development Tools
- `black`: Code formatting
- `ruff`: Linting and code quality
- `mypy`: Static type checking
- `pytest`: Testing framework
- `pre-commit`: Git hooks for code quality
### Common Tasks
```bash
# Format code
black .
# Run linter
ruff check .
# Type checking
mypy .
# Run tests with coverage
pytest --cov
```
### Testing
[![CI](https://img.shields.io/github/actions/workflow/status/petter-b/preservationeval/ci.yml?style=flat&label=ci&logo=github-actions&logoColor=white)](https://github.com/petter-b/preservationeval/actions/workflows/ci.yml)
[![Coverage](https://img.shields.io/codecov/c/github/petter-b/preservationeval?style=flat&color=brightgreen&label=coverage&logo=codecov)](https://codecov.io/gh/petter-b/preservationeval)
[![CodeQL](https://img.shields.io/github/actions/workflow/status/petter-b/preservationeval/codeql.yml?style=flat&label=codeql&logo=github-actions&logoColor=white)](https://github.com/petter-b/preservationeval/actions/workflows/codeql.yml)
#### Validation Testing
The package includes a validation framework that compares the Python implementation
against the original JavaScript implementation from dpcalc.org.
##### Requirements
- Node.js and npm must be installed ([download](https://nodejs.org/))
- Python test dependencies: `pip install -e ".[test]"`
##### Test Data Setup
The test framework automatically:
- Creates the `tests/data` directory (git-ignored)
- Downloads the JavaScript reference implementation
- Generates and saves test cases
- Caches results for future test runs
You can manually trigger this setup:
```bash
# Download JavaScript reference implementation
# This happens automatically when running tests, or manually:
python -m tests.validate_core
# Run all tests
pytest
# Run only validation tests
pytest tests/test_validation.py
# Run with verbose output
pytest -v tests/test_validation.py
# Generate new test cases (ignore cached)
pytest tests/test_validation.py --force-update
```
### Code Quality
[![Black](https://img.shields.io/badge/code%20style-black-000000?style=flat&logo=python&logoColor=white)](https://github.com/psf/black)
[![Ruff](https://img.shields.io/badge/ruff-recommended-red?style=flat&logo=ruff&logoColor=white)](https://github.com/astral-sh/ruff)
[![Mypy](https://img.shields.io/badge/mypy-typed-blue?style=flat&logo=python&logoColor=white)](http://mypy-lang.org/)
### Automation
[![Pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?style=flat&logo=pre-commit&logoColor=white)](https://github.com/petter-b/preservationeval/blob/main/.pre-commit-config.yaml)
[![Pre-commit CI](https://img.shields.io/badge/pre--commit%20ci-passing-brightgreen?style=flat&logo=pre-commit&logoColor=white)](https://results.pre-commit.ci/latest/github/petter-b/preservationeval/main)
[![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen?style=flat&logo=renovatebot&logoColor=white)](https://renovatebot.com)
## Development Notes
This project was developed with assistance from Claude AI (Anthropic) and to some extent Codeium and GitHub Copilot. All code has been validated and tested for accuracy.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Changelog
See [CHANGELOG.md](CHANGELOG.md) for all changes and versioning details.
Raw data
{
"_id": null,
"home_page": null,
"name": "preservationeval",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": "Petter Blomberg <petter.blomberg@gmail.com>",
"keywords": "preservation, climate, numpy",
"author": null,
"author_email": "Petter Blomberg <petter.blomberg@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/30/15/e4f94addeba04f820577ec44d976b1a811f493d118f06417c58d9c14bfed/preservationeval-0.3.1.tar.gz",
"platform": null,
"description": "# preservationeval\n\n[![PyPI](https://img.shields.io/pypi/v/preservationeval?style=flat&color=blue&label=pypi&logo=pypi)](https://pypi.org/project/preservationeval/)\n[![Python](https://img.shields.io/pypi/pyversions/preservationeval?style=flat&color=blue&logo=python)](https://pypi.org/project/preservationeval/)\n[![CI](https://img.shields.io/github/actions/workflow/status/petter-b/preservationeval/ci.yml?style=flat&label=CI&logo=github-actions&logoColor=white)](https://github.com/petter-b/preservationeval/actions/workflows/ci.yml)\n[![Coverage](https://img.shields.io/codecov/c/github/petter-b/preservationeval?style=flat&color=brightgreen&label=coverage&logo=codecov)](https://codecov.io/gh/petter-b/preservationeval)\n[![License](https://img.shields.io/badge/license-MIT-blue?style=flat&logo=opensourceinitiative&logoColor=white)](https://opensource.org/licenses/MIT)\n\nA Python implementation of the calculations and evaluations done by the Dew Point Calculator found at https://www.dpcalc.org/.\n\n## Details\nThe preservation evaluation is inspired by the [Dew point calulator](http://www.dpcalc.org) created by the Image Permanence Institute. They are publishing their code http://www.dpcalc.org/dp.js and most of the work in this project has been spent on figuring out how to install this package without redistributing the core lookup tables. These tables are downloaded from the Internet and converted into a python module during installation of the package.\n\n## Installation\n\n```bash\npip install preservationeval\n```\n\n## Usage\n\n### Basic Examples\n```python\nfrom preservationeval import pi, emc, mold\n\n# Calculate Preservation Index\npi_value = pi(20, 50) # temperature=20\u00b0C, RH=50%\nprint(f\"Preservation Index: {pi_value}\")\n\n# Calculate EMC (Equilibrium Moisture Content)\nemc_value = emc(20, 50)\nprint(f\"EMC: {emc_value}%\")\n\n# Calculate Mold Risk\nmold_risk = mold(20, 50)\nprint(f\"Mold Risk: {mold_risk}\")\n```\n\n### Interpreting Restults\n\nFor details of how to use, see:\n - http://www.dpcalc.org/howtouse_step2.php\n\n## Development\n\n[![Project Status](https://img.shields.io/pypi/status/preservationeval?style=flat&color=blue&label=status&logo=pypi)](https://pypi.org/project/preservationeval/)\n[![Downloads](https://img.shields.io/pepy/dt/preservationeval?style=flat&color=blue&logo=python&logoColor=white)](https://pepy.tech/project/preservationeval)\n[![Issues](https://img.shields.io/github/issues/petter-b/preservationeval?style=flat&color=yellow&logo=github)](https://github.com/petter-b/preservationeval/issues/)\n\n### Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/petter-b/preservationeval\ncd preservationeval\n\n# Install development dependencies\npip install -e \".[dev]\"\n```\n\n### Development Tools\n- `black`: Code formatting\n- `ruff`: Linting and code quality\n- `mypy`: Static type checking\n- `pytest`: Testing framework\n- `pre-commit`: Git hooks for code quality\n\n### Common Tasks\n```bash\n# Format code\nblack .\n\n# Run linter\nruff check .\n\n# Type checking\nmypy .\n\n# Run tests with coverage\npytest --cov\n```\n\n### Testing\n[![CI](https://img.shields.io/github/actions/workflow/status/petter-b/preservationeval/ci.yml?style=flat&label=ci&logo=github-actions&logoColor=white)](https://github.com/petter-b/preservationeval/actions/workflows/ci.yml)\n[![Coverage](https://img.shields.io/codecov/c/github/petter-b/preservationeval?style=flat&color=brightgreen&label=coverage&logo=codecov)](https://codecov.io/gh/petter-b/preservationeval)\n[![CodeQL](https://img.shields.io/github/actions/workflow/status/petter-b/preservationeval/codeql.yml?style=flat&label=codeql&logo=github-actions&logoColor=white)](https://github.com/petter-b/preservationeval/actions/workflows/codeql.yml)\n\n#### Validation Testing\nThe package includes a validation framework that compares the Python implementation\nagainst the original JavaScript implementation from dpcalc.org.\n\n##### Requirements\n- Node.js and npm must be installed ([download](https://nodejs.org/))\n- Python test dependencies: `pip install -e \".[test]\"`\n\n##### Test Data Setup\nThe test framework automatically:\n- Creates the `tests/data` directory (git-ignored)\n- Downloads the JavaScript reference implementation\n- Generates and saves test cases\n- Caches results for future test runs\n\nYou can manually trigger this setup:\n```bash\n# Download JavaScript reference implementation\n# This happens automatically when running tests, or manually:\npython -m tests.validate_core\n\n# Run all tests\npytest\n\n# Run only validation tests\npytest tests/test_validation.py\n\n# Run with verbose output\npytest -v tests/test_validation.py\n\n# Generate new test cases (ignore cached)\npytest tests/test_validation.py --force-update\n```\n\n### Code Quality\n[![Black](https://img.shields.io/badge/code%20style-black-000000?style=flat&logo=python&logoColor=white)](https://github.com/psf/black)\n[![Ruff](https://img.shields.io/badge/ruff-recommended-red?style=flat&logo=ruff&logoColor=white)](https://github.com/astral-sh/ruff)\n[![Mypy](https://img.shields.io/badge/mypy-typed-blue?style=flat&logo=python&logoColor=white)](http://mypy-lang.org/)\n\n### Automation\n[![Pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?style=flat&logo=pre-commit&logoColor=white)](https://github.com/petter-b/preservationeval/blob/main/.pre-commit-config.yaml)\n[![Pre-commit CI](https://img.shields.io/badge/pre--commit%20ci-passing-brightgreen?style=flat&logo=pre-commit&logoColor=white)](https://results.pre-commit.ci/latest/github/petter-b/preservationeval/main)\n[![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen?style=flat&logo=renovatebot&logoColor=white)](https://renovatebot.com)\n\n## Development Notes\n\nThis project was developed with assistance from Claude AI (Anthropic) and to some extent Codeium and GitHub Copilot. All code has been validated and tested for accuracy.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for all changes and versioning details.\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python implementation of the calculations and evaluations done by the Dew Point Calculator found at https://www.dpcalc.org/.",
"version": "0.3.1",
"project_urls": {
"Documentation": "https://github.com/petter-b/preservationeval#readme",
"Homepage": "https://github.com/petter-b/preservationeval",
"Issues": "https://github.com/petter-b/preservationeval/issues",
"Repository": "https://github.com/petter-b/preservationeval.git"
},
"split_keywords": [
"preservation",
" climate",
" numpy"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3015e4f94addeba04f820577ec44d976b1a811f493d118f06417c58d9c14bfed",
"md5": "19b53142665b7aceab1c24b06f3f9d9c",
"sha256": "d042687967fa6ec39ff4bea5fd9aa38fa61281db9c24a63b30d9277a6fe501fb"
},
"downloads": -1,
"filename": "preservationeval-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "19b53142665b7aceab1c24b06f3f9d9c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 34730,
"upload_time": "2024-11-25T19:43:40",
"upload_time_iso_8601": "2024-11-25T19:43:40.543588Z",
"url": "https://files.pythonhosted.org/packages/30/15/e4f94addeba04f820577ec44d976b1a811f493d118f06417c58d9c14bfed/preservationeval-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-25 19:43:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "petter-b",
"github_project": "preservationeval#readme",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "preservationeval"
}