Skip to content

Commit

Permalink
Merge pull request #158 from OMS-NetZero/conda-forge
Browse files Browse the repository at this point in the history
add conda-forge info
  • Loading branch information
chrisroadmap authored Apr 7, 2024
2 parents bea6d7d + 2089e6b commit 395ab8a
Show file tree
Hide file tree
Showing 11 changed files with 368 additions and 357 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
---------

master
------

(`#158 <https://github.com/OMS-NetZero/FAIR/pull/158>`_) Add `fair` to `conda-forge`

v2.1.4
------

Expand Down
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Documentation Status](https://readthedocs.org/projects/fair/badge/?version=latest)](http://fair.readthedocs.io/en/latest/?badge=latest)
[![image](https://zenodo.org/badge/DOI/10.5281/zenodo.1340643.svg)](https://doi.org/10.5281/zenodo.1340643)
[![image](https://codecov.io/gh/OMS-NetZero/FAIR/branch/master/graph/badge.svg)](https://codecov.io/gh/OMS-NetZero/FAIR)
[![image](https://img.shields.io/pypi/v/fair)](https://pypi.org/project/fair/) [![Anaconda-Server Badge](https://anaconda.org/chrisroadmap/fair/badges/version.svg)](https://anaconda.org/chrisroadmap/fair)
[![image](https://img.shields.io/pypi/v/fair)](https://pypi.org/project/fair/) [![Anaconda-Server Badge](https://anaconda.org/conda-forge/fair/badges/version.svg)](https://anaconda.org/conda-forge/fair)

# FaIR

Expand All @@ -18,13 +18,19 @@ forcing scenarios.

## Installation

### From the Python Package Index
### From anaconda (recommended)

pip install fair
**NEW!** from v2.1.4, `fair` is available on `conda-forge`:

conda install -c conda-forge fair

Older versions of `fair` (1.6.2+, 2.1.0-4) can be installed from the `chrisroadmap` channel:

### From anaconda
conda install -c chrisroadmap fair==X.Y.Z

conda install -c chrisroadmap fair
### From the Python Package Index

pip install fair

### From source

Expand Down Expand Up @@ -64,14 +70,13 @@ looks right.

We have produced IPCC AR6 Working Group 1 consistent probabilistic
ensembles to run with. The calibration data can be obtained
[here](https://doi.org/10.5281/zenodo.7694879). These parameter sets are
[here](https://doi.org/10.5281/zenodo.7112539). These parameter sets are
calibrated to CMIP6 models, run in a large Monte Carlo ensemble, and
constrained based on observed and assessed climate metrics. For an
example of how to use this calibration data set with SSP emissions, see
[this
example](https://docs.fairmodel.net/en/latest/examples/calibrated_constrained_ensemble.html).
If you\'re writing a paper using FaIR, you should use these. There\'ll
be a paper on this at some point, for now please cite the Zenodo DOI.
If you\'re writing a paper using FaIR, you should use these. A paper describing this method has been submitted, but for now please cite the Zenodo DOI.

## Citation

Expand Down
28 changes: 14 additions & 14 deletions docs/examples/basic_run_example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ A run is initialised as follows:

::

f = FAIR()
f = FAIR()

To this we need to add some information about the time horizon of our
model, forcers we want to run with, their configuration (and the
Expand All @@ -40,38 +40,38 @@ options:

::

f.define_time(2000, 2050, 1)
f.define_scenarios(['abrupt', 'ramp'])
f.define_configs(['high', 'central', 'low'])
f.define_species(species, properties)
f.ghg_method='Myhre1998'
f.define_time(2000, 2050, 1)
f.define_scenarios(['abrupt', 'ramp'])
f.define_configs(['high', 'central', 'low'])
f.define_species(species, properties)
f.ghg_method='Myhre1998'

We generate some variables: emissions, concentrations, forcing,
temperature etc.:

::

f.allocate()
f.allocate()

which creates ``xarray`` DataArrays that we can fill in:

::

fill(f.emissions, 40, scenario='abrupt', specie='CO2 FFI')
...
fill(f.emissions, 40, scenario='abrupt', specie='CO2 FFI')
...

Finally, the model is run with

::

f.run()
f.run()

Results are stored within the ``FAIR`` instance as ``xarray`` DataArrays
or Dataset, and can be obtained such as

::

print(fair.temperature)
print(fair.temperature)

Multiple ``scenarios`` and ``configs`` can be supplied in a ``FAIR``
instance, and due to internal parallelisation is the fastest way to run
Expand Down Expand Up @@ -255,7 +255,7 @@ the properties; but
- ``type`` defines the species type such as CO2, an aerosol precursor,
or volcanic forcing; there’s around 20 pre-defined types in FaIR.
Some can only be defined once in a run, some can have multiple
instances (e.g. ``f-gas``). See ``fair.structure.species`` for a
instances (e.g. ``f-gas``). See ``fair.structure.species`` for a
list.
- ``input_mode``: how the model should be driven with this ``specie``.
Valid values are ``emissions``, ``concentration``, ``forcing`` or
Expand Down Expand Up @@ -464,8 +464,8 @@ future.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This defines how the model responds to a forcing: the default behaviour
is the three-layer energy balance model as described in Cummins et al.
(2020). The number of layers can be changed in ``run_control``.
is the three-layer energy balance model as described in Cummins et
al. (2020). The number of layers can be changed in ``run_control``.

``climate_configs`` is an ``xarray`` Dataset.

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/n-layer-ebm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This notebook shows examples of extending the 3-layer energy balance
model to general n.

For the two and three layer cases we’ll take the MLE estimates from
Cummins et al. (2020) for HadGEM2-ES, and we’ll use the GISS forcing.
Cummins et al. (2020) for HadGEM2-ES, and we’ll use the GISS forcing.
Where n > 3 the data is fake.

.. code:: ipython3
Expand Down
21 changes: 11 additions & 10 deletions docs/install.rst
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
Installation
============

From the Python Package Index (PyPI)
------------------------------------
`fair` requires `python` 3.8-3.11. `python` 3.12 will probably work but is not extensively tested yet.

From anaconda (recommended)
-------------

Requires `python` 3.8, 3.9, 3.10 or 3.11. Probably the easiest way to get up and running.
::

pip install fair
conda install -c conda-forge fair

From anaconda
-------------

::
From the Python Package Index (PyPI)
------------------------------------

conda install -c chrisroadmap fair
::

pip install fair

From GitHub
-----------

The latest release can be obtained from https://github.com/OMS-NetZero/FAIR/releases as zip or tarball files, or the most current unreleased version can be cloned from https://github.com/OMS-NetZero/FAIR.
The latest release can be obtained from https://github.com/OMS-NetZero/FAIR/releases as zip or tarball files, or the most current unreleased version can be cloned from https://github.com/OMS-NetZero/FAIR.

To install::

pip install -e .[dev]

This will also give access to the notebooks in the `examples` directory, so you can experiment with the model using these as a starting point. For this to work, you should launch notebooks from the same directory in which you install `FAIR` locally.

Guide for developers
Expand Down
Loading

0 comments on commit 395ab8a

Please sign in to comment.