Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English · 中文

conscipy + Orange3-Conservation

Python tooling for preventive conservation of heritage collections: humidity and psychrometric calculations, damage functions, mould growth models, and an Orange Data Mining widget set that puts all of it on a visual canvas.

Derived work. Ported to Python from ConSciR v0.3.0 (commit fe59026) by Tai-Sheng Yeh, August 2026, under GPL-3. See NOTICE for the full list of modifications.

Directory What it is
conscipy/ The calculation library. Pure NumPy/pandas, no GUI dependency.
orange3-conservation/ Five Orange widgets built on it.
docs/ Tutorial, beginner to advanced.

Tutorial

English · 中文 — installation through to the damage functions, the Orange widgets, and how the port is verified. Every number and figure on those pages is generated by running the code, not typed in.

There is a Colab companion for the library half (Orange needs a desktop):

  • English — Open In Colab
  • 中文 — Open In Colab

Why

Python already has the physics layer — psychrolib, CoolProp, psychrochart, MetPy — but nothing on PyPI implements the conservation layer: preservation index, lifetime multiplier, Zeng mould isopleths, the VTT mould index, wood equilibrium moisture content, or the Getty envelope classification that says whether a reading needs heating, humidification or dehumidification. That gap is what this fills.

Install

Order matters; the add-on depends on the library.

pip install -e conscipy
pip install -e orange3-conservation   # optional, for the Orange widgets

Neither is on PyPI yet. Both are packaged and ready to be — see RELEASING.md.

The commands are the same on Windows, macOS and Linux. What differs is which Python interpreter they install into, and on macOS that is easy to get wrong.

macOS

Use python3 -m pip; macOS has no bare python command.

If you installed Orange from the .dmg — the usual route, the Apple Silicon or Intel bundle from orangedatamining.com/download — then the add-on has to go into the Python inside the app bundle, not the one on your $PATH:

/Applications/Orange3.app/Contents/MacOS/pip install -e conscipy
/Applications/Orange3.app/Contents/MacOS/pip install -e orange3-conservation

That pip is a small wrapper the bundle ships around its own python -m pip. The launcher starts Orange with PYTHONNOUSERSITE=1 and PYTHONSAFEPATH=1, so anything installed into system Python — or with pip install --user — is invisible to it however cheerful the install log was. If Orange comes up without a Conservation Science category, this is nearly always the reason.

If Orange came from pip or conda instead, there is no bundle: activate that environment and use the plain commands above. The same applies to the Add-ons dialog — Options ▸ Add-ons ▸ Add more… installs into whichever Python is running Orange, so it is always a safe alternative to the terminal.

Homebrew and the system python3 will refuse outright, with error: externally-managed-environment (PEP 668). Make a virtual environment first:

python3 -m venv .venv && source .venv/bin/activate

Two smaller macOS-only wrinkles: the Apple Silicon bundle needs macOS 11 or later, and on first launch Gatekeeper may block the app — open it once with right-click ▸ Open (or File ▸ Open in Finder) rather than a double-click.

Restart Orange after installing, on any platform.

Quick start

import conscipy as cp

cp.calcDP(21.8, 36.8)        # 6.38397   dew point, °C
cp.calcPI(21.8, 36.8)        # 45.2585   preservation index, years
cp.calcRH_AH(23.8, 7.0524)   # 32.8197   RH if the air were 2 °C warmer

For Orange, restart the application after installing; a Conservation Science category appears in the widget toolbox. Open Help ▸ Example Workflows ▸ Conservation Science Examples ▸ collection-environment and tick Use synthetic demo data to run the whole pipeline without a file.

Tests

python -m pytest conscipy/tests -q
xvfb-run -a python -m pytest orange3-conservation/orangecontrib/conservation/tests -q

(On Windows or macOS drop xvfb-run -a; it is only needed on a headless Linux box to give Qt a display.)

The library suite checks the port against the numbers printed in the ConSciR README (dew point, absolute humidity, preservation index, and the "RH if 2 °C warmer" scenario) to a relative tolerance of 1e-6. The widget suite uses Orange's own WidgetTest harness, so it exercises the real signal plumbing.

Licence and citation

GPL-3.0-or-later, matching ConSciR. If you use this in published work, please cite the original package and the framework it implements:

Shah, B., Cosaert, A., Beltran, V., et al. ConSciR: Tools for Conservation Science. R package. https://bhavshah01.github.io/ConSciR/

Cosaert, A., Beltran, V., et al. (2022). Tools for the Analysis of Collection Environments. Getty Conservation Institute.

About

Preventive conservation tools in Python: humidity, psychrometrics, damage functions and mould models, plus an Orange Data Mining widget set. GPL-3 port of the R package ConSciR.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages