Metadata-Version: 2.1
Name: preservationeval
Version: 0.1.0
Summary: A Python implenentation of the calculations and evaluations done by the Dew Point Calculator found at https://www.dpcalc.org/.
Author-email: Petter Blomberg <petter.blomberg@gmail.com>
Maintainer-email: Petter Blomberg <petter.blomberg@gmail.com>
Project-URL: Homepage, https://github.com/petter-b/preservationeval
Project-URL: Documentation, https://github.com/petter-b/preservationeval#readme
Project-URL: Repository, https://github.com/petter-b/preservationeval.git
Project-URL: Issues, https://github.com/petter-b/preservationeval/issues
Keywords: preservation,climate,numpy
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENCE
Requires-Dist: numpy<2.0.0,>=1.26.0
Requires-Dist: requests<3.0.0,>=2.31.0
Provides-Extra: test
Requires-Dist: pytest>=7.4.0; extra == "test"
Requires-Dist: pytest-mypy>=0.10.3; extra == "test"
Requires-Dist: pytest-cov>=4.1.0; extra == "test"
Requires-Dist: pytest-benchmark>=4.0.0; extra == "test"
Requires-Dist: requests-mock>=1.11.0; extra == "test"
Provides-Extra: lint
Requires-Dist: mypy>=1.13.0; extra == "lint"
Requires-Dist: black>=24.10.0; extra == "lint"
Requires-Dist: ruff>=0.7.3; extra == "lint"
Requires-Dist: pre-commit>=3.6.0; extra == "lint"
Requires-Dist: types-setuptools>=69.0.0; extra == "lint"
Provides-Extra: profile
Requires-Dist: memory_profiler>=0.61.0; extra == "profile"
Provides-Extra: dev
Requires-Dist: preservationeval[lint,profile,test]; extra == "dev"

# 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 implenentation of the calculations and evaluations done by the Dew Point Calculator found at https://www.dpcalc.org/.

## Details
The preservation evaluation code was taken from the [Dew point calulator](http://www.dpcalc.org) created by the Image Permanence Institute. For details of the calculations see:
 - http://www.dpcalc.org/howtouse_step2.php
 - http://www.dpcalc.org/dp.js


## 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

TBD

## 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 our 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 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.
