Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Env instructions #70

Merged
merged 14 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.DS_store

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -39,6 +41,7 @@ pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
cov_html
.tox/
.nox/
.coverage
Expand Down
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ Open source multi-objective energy system framework
[![status](https://joss.theoj.org/papers/183a04edba2d4952fa1e30c419a844b3/status.svg)](https://joss.theoj.org/papers/183a04edba2d4952fa1e30c419a844b3)
[![Build Status](https://github.com/arfc/osier/actions/workflows/CI.yml/badge.svg)](https://github.com/arfc/osier/actions/workflows/CI.yml)
[![Documentation Status](https://readthedocs.org/projects/osier/badge/?version=latest)](https://osier.readthedocs.io/en/latest/?badge=latest)

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/samgdotson/osier/env-instructions?labpath=docs%2Fsource%2Fexamples)


## Installation

### Method 1: PyPI

`osier` is available through [PyPI](https://pypi.org/project/osier/). It may be installed with
```bash
python -m pip install osier
Expand All @@ -23,8 +25,21 @@ git clone https://github.com/arfc/osier.git
cd osier
# for a basic installation
pip install .
# to also install the documentation dependencies
# (Windows/Linux) to also install the documentation dependencies
pip install .[doc]
# (MacOS)
pip install .'[doc]'
```

### Method 2: Conda/Mamba Environment

Although `osier` is not yet available on `conda-forge`, you may have a more consistent experience by installing
`osier` via a `conda` environment.

```bash
git clone [email protected]:arfc/osier.git # requires ssh-keys
mamba env create # mamba and conda are interchangeable, here
mamba activate osier-env
```


Expand All @@ -40,6 +55,14 @@ cd build/html
python -m http.server
```

## Examples

The examples can be found in the `docs/source/examples/` directory. Alternatively,
users can run the notebooks and experiment with `osier` through the Binder app.

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/samgdotson/osier/env-instructions?labpath=docs%2Fsource%2Fexamples)


## Tests
`osier`'s tests can be run by executing `pytest` in the top-level directory
of `osier`.
Expand Down
5 changes: 3 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
# -- Project information -----------------------------------------------------

project = 'osier'
copyright = '2022, Samuel Dotson'
copyright = '2022-2024, Samuel Dotson'
author = 'Samuel Dotson'

# The full version, including alpha/beta/rc tags
release = '0.2.1'
release = '0.3.0'


# -- General configuration ---------------------------------------------------
Expand All @@ -44,6 +44,7 @@
"sphinx.ext.mathjax",
"sphinx.ext.coverage",
"nbsphinx",
"nbsphinx_link"
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
124 changes: 66 additions & 58 deletions docs/source/examples/capacity_expansion_tutorial.ipynb
samgdotson marked this conversation as resolved.
Show resolved Hide resolved

Large diffs are not rendered by default.

417 changes: 417 additions & 0 deletions docs/source/examples/getting_started.ipynb
samgdotson marked this conversation as resolved.
Show resolved Hide resolved

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/source/examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This section has examples that guide users from basic usage to more advanced top
```{toctree}
:maxdepth: 3

getting_started
tech_tutorial
dispatch_tutorial
capacity_expansion_tutorial
Expand Down
27 changes: 27 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: osier-env
channels:
- conda-forge

dependencies:
- python>=3.9
- pip
- ipython
- ipykernel
- jupyterlab
- pandas
- scipy
- glpk
- coincbc
- yaml
- numpy
- matplotlib
- pytest
- pytest-cov
- pyomo
- pip:
- pymoo
- pyentrp
- deap
- dill
- openpyxl
- osier
2 changes: 1 addition & 1 deletion osier/technology.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
'specific_power': MW**-1,
'specific_energy': (MW * hr)**-1,
'mass_per_energy': megatonnes * (MW * hr)**-1,
'area_per_power': km * MW**-2}
'area_per_power': km**2 * MW**-1}

_constant_types = (int, float, unyt_quantity)
_array_types = (unyt.unyt_array, pd.core.series.Series, np.ndarray, list)
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ doc = [
'numpydoc',
'pydata_sphinx_theme',
'nbsphinx',
'pandoc'
'pandoc',
'nbsphinx-link',
]

[tool.setuptools.packages.find]
Expand Down
Loading