Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
628acbb
Add comprehensive testing infrastructure with CI/CD
bernalde Oct 3, 2025
3b029b0
Adding all the files for setting up start of development
bernalde Oct 3, 2025
60a489d
Adding files from Github CI testing
bernalde Oct 3, 2025
1cfd914
Adding github files and cursor aiding files
bernalde Oct 3, 2025
ef9122a
More files input
bernalde Oct 3, 2025
3a2da8d
Fix CI: Install lyopronto package for legacy script tests
bernalde Oct 3, 2025
9fb0d19
Fix CI: Install lyopronto package for legacy script tests
bernalde Oct 3, 2025
c491253
Clean up examples/outputs directory
bernalde Oct 3, 2025
ca0cd6e
Optimize CI performance with dual-workflow strategy
bernalde Oct 3, 2025
9064051
Implement draft-aware CI workflow (recommended approach)
bernalde Oct 3, 2025
9c473d8
Address review: Replace magic numbers with named constants in test_op…
bernalde Oct 3, 2025
09b7beb
Add conda environment and modern Python packaging
bernalde Oct 29, 2025
598b563
Fix unit conversion: output fraction (0-1) not percentage (0-100)
bernalde Oct 29, 2025
db02bcc
Fix edge case handling in design_space for empty arrays
bernalde Oct 29, 2025
9557ff9
Add missing T_pr_crit parameter to product test fixtures
bernalde Oct 29, 2025
98795a1
Update tests for fraction format (0-1) instead of percentage (0-100)
bernalde Oct 29, 2025
7aa0c9b
Fix coverage test expectations for realistic optimizer behavior
bernalde Oct 29, 2025
826dd15
Add example_optimizer.py with run_optimizer_example function
bernalde Oct 29, 2025
b4068d1
Restore legacy example scripts from git history
bernalde Oct 29, 2025
40a4c08
Enable parallel testing with pytest-xdist for 4x speedup
bernalde Oct 29, 2025
e01b793
Populate requirements-dev.txt with development dependencies
bernalde Oct 29, 2025
570e078
Update .gitignore for Python build artifacts and restore test data
bernalde Oct 29, 2025
1c89c07
Fix percentage format in remaining test assertions
bernalde Oct 29, 2025
0dffd33
Restore test files from testing-infrastructure branch
bernalde Oct 29, 2025
30db419
Merge dev-pyomo: Fix critical unit conversion bug and expand test suite
bernalde Oct 29, 2025
6fd6524
Fix CI: Ensure setuptools is installed before package installation
bernalde Oct 29, 2025
1a11b57
Address PR review: Replace magic numbers with named constants
bernalde Oct 29, 2025
7507fbb
Fix ModuleNotFoundError: Move assert_physically_reasonable_output to …
bernalde Oct 29, 2025
af3b641
Fix test_helpers: Allow last time step to be repeated
bernalde Oct 29, 2025
7886139
Address PR review comments: add constants and clarify edge cases
bernalde Oct 29, 2025
03ae6d5
Fix spacing inconsistencies in multiple files
bernalde Oct 29, 2025
5b4e532
Fix remaining spacing inconsistencies in opt_Pch, design_space, and f…
bernalde Oct 29, 2025
01900a3
Standardize all unit comments to use brackets [unit]
bernalde Oct 29, 2025
c699d74
Implement three-tier testing strategy to reduce CI time
bernalde Oct 29, 2025
6369e92
Update lyopronto/freezing.py
bernalde Oct 29, 2025
59fd572
Update inconsistent unit
bernalde Oct 29, 2025
c801a87
Refactor length checks to use .size for numpy arrays in example_freez…
bernalde Oct 29, 2025
135fdd7
Add centralized CI version configuration and update workflows to use …
bernalde Oct 29, 2025
227e390
Refactor GitHub Actions workflows to streamline checkout steps and im…
bernalde Oct 29, 2025
55f0d32
Fix formatting of comments for product resistance and sublimation flu…
bernalde Oct 29, 2025
342e4e7
Remove unnecessary files
bernalde Oct 29, 2025
b768a52
Update CI workflows to reference centralized Python version configura…
bernalde Oct 29, 2025
ae36812
Update documentation to standardize temperature and pressure units ac…
bernalde Oct 29, 2025
96d2f07
Refactor README to streamline test organization and improve clarity o…
bernalde Oct 29, 2025
2978b92
Fix unit formatting for equipment capability coefficients in test files
bernalde Oct 29, 2025
fb0740d
Standardize time and pressure unit formatting across documentation an…
bernalde Oct 29, 2025
5bb52a0
Enhance CONTRIBUTING and documentation with detailed CI/CD testing gu…
bernalde Oct 29, 2025
fb04c79
Standardize unit formatting in mass balance tests for clarity
bernalde Oct 30, 2025
229d328
Merge pull request #1 from SECQUOIA:feature/testing-infrastructure
bernalde Nov 13, 2025
05b0ec5
Merge upstream/docs: combine CI python-version setup and add mkdocs-i…
bernalde Nov 24, 2025
cddbb48
Merge upstream/main into main: resolve docs workflow and preserve exa…
bernalde Nov 24, 2025
219d713
Merge pull request #4 from SECQUOIA/fix/upstream-incompatibility
bernalde Nov 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .aidigestignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# AI Digest Ignore
# Files that AI assistants should ignore or deprioritize

# Generated output
htmlcov/
*.pyc
__pycache__/
.pytest_cache/
.coverage
*.egg-info/

# Temporary files
debug_*.py
scratch_*.py
temp_*.py
test_temp*.py

# Large data files
*.csv
*.xlsx
*.h5
*.hdf5

# Binary files
*.png
*.jpg
*.pdf

# Build artifacts
dist/
build/
*.so
*.dylib
*.dll

# IDE files
.vscode/
.idea/
*.swp
*.swo
*~

# Git files
.git/
.gitignore

# Documentation builds
docs/_build/
site/
Binary file added .coverage
Binary file not shown.
111 changes: 111 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Cursor AI Rules for LyoPRONTO

## Project Overview
LyoPRONTO is a lyophilization (freeze-drying) process simulator. Currently transitioning from scipy to Pyomo for optimization.

## Code Generation Preferences

### Always
- Use NumPy-style docstrings
- Include type hints in function signatures
- Add units in comments for physical variables
- Write tests before implementing features (TDD)
- Use descriptive variable names matching physics conventions

### Never
- Don't use `if` statements in Pyomo constraint expressions
- Don't assume output columns are in obvious units (check documentation)
- Don't use bare `except:` clauses
- Don't repeat code - use functions and fixtures
- Don't skip writing tests

## Physics Variable Standards

Use these exact names for consistency:
- `Tsub` (sublimation temperature, °C)
- `Tbot` (vial bottom temperature, °C)
- `Tsh` (shelf temperature, °C)
- `Pch` (chamber pressure, Torr in input, mTorr in output)
- `Rp` (product resistance, cm²-hr-Torr/g)
- `dmdt` (sublimation rate, kg/hr)
- `Lck` (cake length, cm)
- `Lpr0` (initial product length, cm)

## Testing Requirements

For every new function:
1. Write at least 2 unit tests (normal case + edge case)
2. Test physical bounds and monotonicity
3. Use fixtures from `tests/conftest.py`
4. Add docstring explaining what's being tested

Example test structure:
```python
def test_my_function_normal_case():
"""Test my_function with typical input values."""
result = my_function(typical_input)
assert result > 0
assert np.isclose(result, expected, rtol=0.01)

def test_my_function_edge_case():
"""Test my_function with boundary conditions."""
result = my_function(edge_case_input)
assert result is physically_reasonable
```

## Output Format Reminder

**CRITICAL**: When working with `calc_knownRp.dry()` output:
```python
# output[:, 4] is in mTorr, not Torr!
# output[:, 6] is fraction 0-1, not percentage 0-100!
```

Always reference `TEST_FIXES_SUMMARY.md` when working with outputs.

## Pyomo Model Guidelines

1. **Initialization**: Always warmstart with scipy solution
2. **Bounds**: Use physically reasonable bounds on all variables
3. **Exponentials**: Use log-transform for vapor pressure equation
4. **Constraints**: Make implicit equations explicit equality constraints

## File Organization

- Physics equations → `lyopronto/functions.py`
- Simulators → `lyopronto/calc_*.py`
- Tests → `tests/test_*.py`
- Pyomo models → `lyopronto/pyomo_models/` (create if needed)

## Performance Considerations

- Profile before optimizing
- Benchmark Pyomo against scipy baseline
- Target <3x scipy performance for Pyomo
- Use sparse Jacobian structures for large models

## Documentation

Every module should have:
```python
"""Brief module description.

This module contains [what it does].

Key functions:
- function1: Brief description
- function2: Brief description

Notes:
Important physics assumptions or numerical considerations.
"""
```

## Current Priority

Focus on Phase 1 of Pyomo transition:
1. Single time-step optimization model
2. Comparison tests with scipy
3. Validation against existing behavior

Refer to `PYOMO_ROADMAP.md` for detailed plan.
3 changes: 3 additions & 0 deletions .github/ci-config/ci-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Centralized CI version configuration for LyoPRONTO
# Update this file to change Python version across all workflows
python-version: '3.13'
Loading
Loading