Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
acd420f
Add dtocean-economics
H0R5E Mar 27, 2026
5d6d5e0
Start moving interface code and tests
H0R5E Mar 28, 2026
dfcc558
Get interface tests working
H0R5E Mar 29, 2026
a113cb6
Add testing workflow
H0R5E Mar 30, 2026
92f343e
Undo incorrect removal of scipy from dtocean-core
H0R5E Mar 30, 2026
ae3a318
Use easier to calculate expected values in tests
H0R5E Mar 30, 2026
c3723e1
Try and fix some of the units madness
H0R5E Mar 31, 2026
05297d5
Continue with tidy up
H0R5E Apr 1, 2026
b33bf1e
Some other stuff
H0R5E Apr 1, 2026
75087ef
Minor changes
H0R5E Apr 1, 2026
655867e
Finish interface code reorganisation
H0R5E Apr 2, 2026
fab91b5
Fix existing unit tests
H0R5E Apr 2, 2026
98da4cf
Fix ruff
H0R5E Apr 2, 2026
7b2f8fb
Start testing the actual input data manipulation
H0R5E Apr 3, 2026
9fbc89f
Finish update of interface entry test
H0R5E Apr 8, 2026
035252d
Test input estimates properly
H0R5E Apr 13, 2026
3b2d249
Test output conversion for single simulation
H0R5E Apr 13, 2026
705b3d5
Test output conversion for 8 simulations
H0R5E Apr 15, 2026
b666db9
Add LCOE PDF plot
H0R5E Apr 15, 2026
3fdf1c0
Fix bug reading values from _get_outputs
H0R5E Apr 16, 2026
1343d56
Add test for LCOEPDFPlot
H0R5E Apr 16, 2026
5a584fd
Add semantic release config and test publish
H0R5E Apr 16, 2026
450d692
fix: add dtocean_economics to release branches
H0R5E Apr 16, 2026
6f08b86
chore(release): dtocean-economics@2.0.1
Apr 16, 2026
dff6681
fix(dtocean-economics): try again
H0R5E Apr 16, 2026
c8b3fcf
chore(release): dtocean-economics@2.0.2
Apr 16, 2026
c6671d6
Add test release steps to main release workflow
H0R5E Apr 16, 2026
82a18ce
Update package level READMEs
H0R5E Apr 17, 2026
8c9960a
Fix silly bug
H0R5E Apr 17, 2026
2930c13
Update top level README and docs
H0R5E Apr 18, 2026
2199fee
Run prettier on README
H0R5E Apr 18, 2026
339c87d
Estimate opex_bom if externalities given
H0R5E Apr 18, 2026
c525674
Test when only partial inputs are available
H0R5E Apr 18, 2026
6d0ea9f
Reduce LFS downloads for tests
H0R5E Apr 20, 2026
6db5436
Also remove LFS for audit test
H0R5E Apr 20, 2026
3a58120
Use relative path for doctest.testfile
H0R5E Apr 20, 2026
3d1deb6
Test estimated opex with just externalities
H0R5E Apr 20, 2026
a952c0a
Add final tests
H0R5E Apr 21, 2026
8ebd20e
Undo dtocean-core pyproject change
H0R5E Apr 21, 2026
f269b4f
Update lock file
H0R5E Apr 21, 2026
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
*.xcf filter=lfs diff=lfs merge=lfs -text
*.svg filter=lfs diff=lfs merge=lfs -text
*.xlsx filter=lfs diff=lfs merge=lfs -text
*.nc filter=lfs diff=lfs merge=lfs -text
68 changes: 63 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ permissions:
contents: read

env:
DTOCEAN_CORE_DIR: packages/dtocean-core
DTOCEAN_QT_DIR: packages/dtocean-qt
DTOCEAN_DIR: packages/dtocean
DTOCEAN_APP_DIR: packages/dtocean-app
DTOCEAN_HYDRODYNAMICS_DIR: packages/dtocean-hydrodynamics
DTOCEAN_CORE_DIR: packages/dtocean-core
DTOCEAN_DOCS_DIR: packages/dtocean-docs
DTOCEAN_DIR: packages/dtocean
POLITE_CONFIG_DIR: packages/polite-config
DTOCEAN_ECONOMICS_DIR: packages/dtocean-economics
DTOCEAN_HYDRODYNAMICS_DIR: packages/dtocean-hydrodynamics
DTOCEAN_QT_DIR: packages/dtocean-qt
MDO_ENGINE_DIR: packages/mdo-engine
POLITE_CONFIG_DIR: packages/polite-config
RELEASING_REPO: DTOcean/dtocean

jobs:
Expand All @@ -40,6 +41,8 @@ jobs:
dtocean-app-commit_sha: ${{ steps.release-dtocean-app.outputs.commit_sha }}
dtocean-hydrodynamics-released: ${{ steps.release-dtocean-hydrodynamics.outputs.released }}
dtocean-hydrodynamics-commit_sha: ${{ steps.release-dtocean-hydrodynamics.outputs.commit_sha }}
dtocean-economics-released: ${{ steps.release-dtocean-economics.outputs.released }}
dtocean-economics-commit_sha: ${{ steps.release-dtocean-economics.outputs.commit_sha }}
root-released: ${{ steps.release-root.outputs.released }}
root-commit_sha: ${{ steps.release-root.outputs.commit_sha }}
root-tag: ${{ steps.release-root.outputs.tag }}
Expand Down Expand Up @@ -131,6 +134,16 @@ jobs:
push: ${{ github.repository == env.RELEASING_REPO }}
vcs_release: false

- name: Release dtocean-economics
id: release-dtocean-economics
uses: python-semantic-release/python-semantic-release@v10.5.3
with:
commit: ${{ github.repository == env.RELEASING_REPO }}
directory: ${{ env.DTOCEAN_ECONOMICS_DIR }}
github_token: ${{ secrets.GITHUB_TOKEN }}
push: ${{ github.repository == env.RELEASING_REPO }}
vcs_release: false

- name: Release root
id: release-root
uses: ./.github/actions/semantic-release-calver
Expand Down Expand Up @@ -587,6 +600,51 @@ jobs:
packages-dir: ${{ env.DTOCEAN_HYDRODYNAMICS_DIR }}/dist
verbose: true

publish-dtocean-economics:
runs-on: ubuntu-latest
needs: release
if: needs.release.outputs.dtocean-economics-released == 'true'
permissions:
id-token: write
defaults:
run:
working-directory: ${{ env.DTOCEAN_ECONOMICS_DIR }}
environment:
name: pypi
url: https://pypi.org/project/dtocean-economics/
steps:
- name: Setup | Checkout repository on commit sha
uses: actions/checkout@v6
with:
lfs: true
ref: ${{ needs.release.outputs.dtocean-economics-commit_sha }}

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Install poetry
uses: abatilo/actions-poetry@v2

- name: Install poetry-monoranger-plugin
shell: bash
run: |
poetry self add git+https://github.com/H0R5E/poetry-monoranger-plugin.git#include_groups

- name: Update Poetry configuration
run: poetry config virtualenvs.create false

- name: Package project
run: poetry build

- name: Publish package distributions to PyPI
if: ${{ github.repository == env.RELEASING_REPO }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ${{ env.DTOCEAN_ECONOMICS_DIR }}/dist
verbose: true

publish-docs:
needs: release
if: needs.release.outputs.root-released == 'true'
Expand Down
95 changes: 95 additions & 0 deletions .github/workflows/test-dtocean-economics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: dtocean-economics tests
on:
push:
branches:
- main
paths:
- ".codecov.yml"
- ".github/workflows/test-dtocean-economics.yml"
- "packages/dtocean-core/src/**"
- "packages/dtocean-economics/**"
- "poetry.lock"
pull_request:
branches:
- main
paths:
- ".codecov.yml"
- ".github/workflows/test-dtocean-economics.yml"
- "packages/dtocean-core/src/**"
- "packages/dtocean-economics/**"
- "poetry.lock"

jobs:
pytest:
name: Unit tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
python-version: ["3.14", "3.13", "3.12"]
defaults:
run:
working-directory: packages/dtocean-economics
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install package
uses: ./.github/actions/poetry-install
with:
groups: '["dtocean-economics", "test"]'
python-version: ${{ matrix.python-version }}
- name: Run tests
run: |
poetry run pytest
pytest-extras:
name: Unit tests with plugins
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
python-version: ["3.13", "3.12"]
defaults:
run:
working-directory: packages/dtocean-economics
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Git LFS Pull
run: git lfs pull -I packages/dtocean-economics
- name: Install package
uses: ./.github/actions/poetry-install
with:
groups: '["dtocean-core", "dtocean-economics", "test"]'
python-version: ${{ matrix.python-version }}
- name: Run tests
run: |
poetry run pytest -v --cov src --cov-report=xml tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
flags: dtocean-economics
audit:
name: Code audit
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/dtocean-economics
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install package
uses: ./.github/actions/poetry-install
with:
groups: '["audit", "dtocean-core", "dtocean-economics"]'
python-version: 3.13
- name: Run ruff
run: |
poetry run ruff check --output-format github
- name: Run pyright
run: |
poetry run pyright src
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ marine renewable energy arrays.**
DTOcean can calculate:

- Optimal ocean energy converter (OEC) positioning
- <s>Energy export infrastructure</s>
- <s>Station keeping requirements based on OEC performance and site conditions</s>
- <s>Installation planning with weather effects</s>
- <s>Maintenance planning, simulating OEC downtime</s>
- <s>Environmental impact assessment (experimental)</s>
- <del>Energy export infrastructure</del>
- <del>Station keeping requirements based on OEC performance and site conditions</del>
- <del>Installation planning with weather effects</del>
- <del>Maintenance planning, simulating OEC downtime</del>
- <del>Environmental impact assessment (experimental)</del>

And features include:

- <s>A unique statistical approach to calculating levelized cost of energy (LCOE)</s>
- <s>OEC reliability influenced at component level</s>
- A unique statistical approach to calculating levelized cost of energy (LCOE)
- <del>OEC reliability influenced at component level</del>
- Graphical user interface
- Persistent database

Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
- Station keeping designed for device and site conditions [#f2]_
- Installation planning with weather effects [#f2]_
- Maintenance needs and OEC downtime [#f2]_
- A unique statistical approach to LCOE [#f2]_
- A unique statistical approach to LCOE
- Influence reliability at component level [#f2]_
- Environmental impact assessment [#f1]_ [#f2]_
- Graphical user interface
Expand All @@ -55,7 +55,7 @@

.. only:: html

Loved and maintained by `Mathew Topper <mathew.topper@dataonlygreater.com>`_
Loved and maintained by `Mathew Topper <damm_horse@yahoo.co.uk>`_
\@ `Data Only Greater <http://www.dataonlygreater.com>`_

.. rubric:: Footnotes
Expand Down
17 changes: 17 additions & 0 deletions packages/dtocean-economics/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"[markdown]": {
"editor.formatOnSave": true,
},
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "charliermarsh.ruff"
},
"[toml]": {
"editor.formatOnSave": true,
},
"ruff.configuration": "pyproject.toml",
}
31 changes: 31 additions & 0 deletions packages/dtocean-economics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Change Log

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

<!-- version list -->

## [2.0.0] - 2019-03-07

### Added

- Added main function which takes three dataframes, one for CAPEX, OPEX, and
energy plus the discount rate and returns a dictionary of results.
- Added a preprocessing module which provides functions for preparing the
required dataframes and for calculating estimates to the inputs.

### Changed

- Reorganised the functions module to undertake all dataframe manipulation
work. The main function just collects any valid results.
- Now considers multiple series for energy and OPEX, as per changes in
the dtocean-maintenance module. Returns summed, discounted values and LCOE
calculations for each series.

## [1.0.0] - 2017-01-05

### Added

- Initial import of dtocean-economics from SETIS.
Loading
Loading