pyhector
A Python interface for the simple global climate carbon-cycle model Hector.
https://github.com/openclimatedata/pyhector
Category: Climate Change
Sub Category: Earth and Climate Modeling
Keywords
climate-model hector-model python-wrapper
Keywords from Contributors
data-package climate-change climate hector magicc-model scenarios
Last synced: about 1 hour ago
JSON representation
Repository metadata
Python interface for the simple global climate carbon-cycle model Hector
- Host: GitHub
- URL: https://github.com/openclimatedata/pyhector
- Owner: openclimatedata
- License: agpl-3.0
- Created: 2017-01-24T17:14:54.000Z (almost 9 years ago)
- Default Branch: main
- Last Pushed: 2024-03-06T14:34:24.000Z (almost 2 years ago)
- Last Synced: 2025-12-20T04:12:55.126Z (6 days ago)
- Topics: climate-model, hector-model, python-wrapper
- Language: Python
- Homepage: http://pyhector.readthedocs.io/en/latest/
- Size: 16.2 MB
- Stars: 44
- Watchers: 5
- Forks: 10
- Open Issues: 4
- Releases: 15
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
- Zenodo: .zenodo.json
README.rst
pyhector
========
+----------------+------------------------+
| |PyPI Version| | |PyPI Python Versions| |
+----------------+------------------------+
| |Docs| | |Launch Binder| |
+----------------+------------------------+
| |JOSS| | |Zenodo| |
+----------------+------------------------+
.. sec-begin-index
**pyhector** is a Python interface for the simple global climate
carbon-cycle model `Hector `_.
**pyhector** makes the simple climate model Hector easily installable
and usable from Python and can for example be used in the analysis of
mitigation scenarios, in integrated assessment models, complex climate
model emulation, and uncertainty analyses.
`Hector `_ is written in C++ and
developed at the `Pacific Northwest National Laboratory
`_.
See the Hector `repository `_ and
`documentation website `_ for further
information.
The Python interface **pyhector** is developed by `Sven Willner
`_ and `Robert Gieseke
`_.
Pyhector uses `pybind11 `_ to wrap
Hector's API. The version of Hector used can be read using Pyhector's
``__hector_version__`` field.
.. sec-end-index
.. sec-begin-installation
Installation
------------
Prerequisites
~~~~~~~~~~~~~
`Hector `_ requires `Boost
`_, so to install and use **pyhector** you need
to have the filesystem and system modules of *Boost* installed (see also the `Hector build
instructions `_).
On Ubuntu/Debian these can be installed by invoking
.. code:: bash
sudo apt-get install libboost-filesystem-dev libboost-system-dev
On macOS *Boost* is available through the Homebrew package manager, it
might be advisable to use a Homebrew installed Python for installing
**pyhector**:
.. code:: bash
brew install boost
Windows is (as Hector) in principle supported but not yet tested for
**pyhector**. Pull request with installation notes for Windows are
welcome.
Install using pip
~~~~~~~~~~~~~~~~~
You can install **pyhector** from
`PyPI `_ by invoking
.. code:: bash
pip install pyhector
.. sec-end-installation
.. sec-begin-usage
Usage
-----
This repository also contains a `Jupyter Notebook
`_ you can `run
live `_ and
experiment with, courtesy of the `Binder `_
project. The notebook can be viewed as a `static version
`_
using nbviewer.
Basic example
~~~~~~~~~~~~~
.. code:: python
import pyhector
output = pyhector.run(pyhector.ssp126)
Advanced example
~~~~~~~~~~~~~~~~
.. code:: python
import pyhector
import matplotlib.pyplot as plt
from pyhector import ssp119, ssp126, ssp245, ssp370, ssp434, ssp460, ssp534_over, ssp585
for ssp in [ssp119, ssp126, ssp245, ssp370, ssp434, ssp460, ssp534_over, ssp585]:
output = pyhector.run(ssp, {"core": {"endDate": 2100}})
temp = output["temperature.global_tas"]
temp = temp.loc[1850:] - temp.loc[1850:1900].mean()
temp.plot(label=ssp.name)
plt.title("Global mean temperature")
plt.ylabel("°C over pre-industrial (1850-1900 mean)")
plt.legend(loc="best")
plt.show()
.. image-start
.. image:: ./docs/example-plot.png
:alt: Temperature Plot of RCP scenarios
.. image-end
.. sec-end-usage
.. sec-begin-development
Development
-----------
For local development you can clone the repository, update the
dependencies and install in a virtual environment with ``pip``.
.. code:: bash
git clone https://github.com/openclimatedata/pyhector.git --recursive
cd pyhector
python3 -m venv venv
./venv/bin/pip install --editable --verbose .
To update **pyhector** and all submodules you can run
.. code:: bash
git pull --recurse-submodules
git submodule update --init --recursive
./venv/bin/pip install --editable .
Tests can be run locally with
::
python setup.py test
.. sec-end-development
.. |PyPI Python Versions| image:: https://img.shields.io/pypi/pyversions/pyhector.svg
:target: https://pypi.org/project/pyhector/
.. |PyPI Version| image:: https://img.shields.io/pypi/v/pyhector.svg
:target: https://pypi.org/project/pyhector/
.. |Docs| image:: https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat
:target: https://pyhector.readthedocs.io/en/latest/
.. |Launch Binder| image:: https://img.shields.io/badge/launch-binder-e66581.svg
:target: https://mybinder.org/v2/gh/openclimatedata/pyhector/main?filepath=notebooks/index.ipynb
.. |JOSS| image:: https://img.shields.io/badge/JOSS-10.21105%2Fjoss.00248-brightgreen.svg
:target: https://doi.org/10.21105/joss.00248
.. |Zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1194599.svg
:target: https://zenodo.org/record/1194599
Owner metadata
- Name: Open Climate Data
- Login: openclimatedata
- Email:
- Kind: organization
- Description:
- Website: https://openclimatedata.net
- Location: Potsdam, Germany
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/20420557?v=4
- Repositories: 11
- Last ynced at: 2023-03-01T16:55:25.611Z
- Profile URL: https://github.com/openclimatedata
GitHub Events
Total
- Watch event: 4
- Fork event: 1
Last Year
- Watch event: 2
- Fork event: 1
Committers metadata
Last synced: 8 days ago
Total Commits: 508
Total Committers: 2
Avg Commits per committer: 254.0
Development Distribution Score (DDS): 0.299
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| Robert Gieseke | r****e@p****e | 356 |
| Sven Willner | s****r@g****m | 152 |
Committer domains:
Issue and Pull Request metadata
Last synced: 9 days ago
Total issues: 40
Total pull requests: 24
Average time to close issues: 2 months
Average time to close pull requests: about 1 month
Total issue authors: 5
Total pull request authors: 3
Average comments per issue: 1.83
Average comments per pull request: 1.21
Merged pull request: 22
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- rgieseke (36)
- swillner (1)
- jamesmurdza (1)
- russellhz (1)
- tamara-goyea (1)
Top Pull Request Authors
- rgieseke (19)
- swillner (5)
- ckingdon95 (1)
Top Issue Labels
- enhancement (1)
- bug (1)
Top Pull Request Labels
Package metadata
- Total packages: 2
-
Total downloads:
- pypi: 136 last-month
- Total docker downloads: 70
- Total dependent packages: 0 (may contain duplicates)
- Total dependent repositories: 1 (may contain duplicates)
- Total versions: 33
- Total maintainers: 3
proxy.golang.org: github.com/openclimatedata/pyhector
- Homepage:
- Documentation: https://pkg.go.dev/github.com/openclimatedata/pyhector#section-documentation
- Licenses: agpl-3.0
- Latest release: v2.1.3+incompatible (published over 7 years ago)
- Last Synced: 2025-12-22T19:05:50.924Z (3 days ago)
- Versions: 11
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.395%
- Average: 5.576%
- Dependent repos count: 5.758%
pypi.org: pyhector
Python wrapper for the Hector simple climate model
- Homepage: https://github.com/openclimatedata/pyhector
- Documentation: https://pyhector.readthedocs.io/
- Licenses: GNU Affero General Public License v3
- Latest release: 2.0.1 (published almost 8 years ago)
- Last Synced: 2025-12-22T19:05:49.768Z (3 days ago)
- Versions: 22
- Dependent Packages: 0
- Dependent Repositories: 1
- Downloads: 136 Last month
- Docker Downloads: 70
-
Rankings:
- Docker downloads count: 2.678%
- Dependent packages count: 7.31%
- Stargazers count: 10.451%
- Forks count: 11.463%
- Average: 13.313%
- Dependent repos count: 22.088%
- Downloads: 25.887%
- Maintainers (3)
Dependencies
- black * development
- matplotlib * development
- notebook * development
- numpydoc * development
- pybind11 >=2.2 development
- pytest >=4.0 development
- pytest-cov * development
- sphinx >=1.4 development
- sphinx-autobuild * development
- tabulate * development
- twine * development
- wheel * development
- tabulate *
- numpy *
- jupyter/scipy-notebook 2022-01-12 build
Score: 9.916206324943904