该库提供了一个工具,使用离散事件模拟框架来模拟分布式、陆基和海上风电场的运行和维护阶段 (O&M)。
WOMBAT 是围绕SimPy
离散事件模拟框架编写的。此外,还使用灵活且模块化的面向对象的代码库来支持这一点,该代码库可以对任意大型(或小型)风电场进行建模,并可编码任意数量的故障和维护任务。
请注意,该功能仍处于开发阶段,因此您可能会发现某些功能目前尚不完整,但请放心,该功能正在扩展。话虽如此,如果您能提交问题或 PR 来进行任何改进,从修复拼写错误(肯定会有一些)到功能再到测试,我们将不胜感激。
如果您使用此库,请引用我们的 NREL 技术报告:
@techreport{hammond2022wombat, title = {Windfarm Operations and Maintenance cost-Benefit Analysis Tool (WOMBAT)}, author = {Hammond, Rob and Cooperman, Aubryn}, abstractNote = {This report provides technical documentation and background on the newly-developed Wind Operations and Maintenance cost-Benefit Analysis Tool (WOMBAT) software. WOMBAT is an open-source model that can be used to obtain cost estimates for operations and maintenance of land-based or offshore wind power plants. The software was designed to be flexible and modular to allow for implementation of new strategies and technological innovations for wind plant maintenance. WOMBAT uses a process-based simulation approach to model day-to-day operations, repairs, and weather conditions. High-level outputs from WOMBAT, including time-based availability and annual operating costs, are found to agree with published results from other models.}, doi = {10.2172/1894867}, url = {https://www.osti.gov/biblio/1894867}, place = {United States}, year = {2022}, month = {10}, institution = {National Renewable Energy Lab. (NREL)}, }
有一些 Jupyter 笔记本可以让用户在examples/
文件夹中启动并运行 WOMBAT,但这里有一些亮点:
注意 在 v0.6 中,由于后端的大量模型升级以及新的/更新的功能以更好地指定如何管理修复,因此在某些建模条件下,结果将与过去的版本显着不同。
- 丁伍迪等人。的复制
wombat
可以在 _ 中找到examples folder <https://github.com/WISDEM/WOMBAT/blob/main/examples/dinwoodie_validation.ipynb>
。 - IEA 任务 26
validation exercise <https://github.com/WISDEM/WOMBAT/blob/main/examples/iea_26_validation.ipynb>
_。 - 演示文稿:
slides <https://github.com/WISDEM/WOMBAT/blob/main/presentation_material/>
_。
- Python 3.8 到 3.10
注意 对于寻求安装更多基本依赖项的 Python 3.10 用户,我们注意到 pip 可能需要很长时间才能解决所有包要求,因此建议使用以下工作流程:
# Enter the source code directory cd wombat/pip install -e .
pip install -e '.[dev]' # '.[docs]' or '.[all]'
下载适用于适当操作系统的最新版本的Miniconda 。 对于适当的操作系统版本,请执行其余 步骤。
使用conda,创建一个新的虚拟环境:
conda create -n <environment_name> python=3.8 --no-default-packages conda activate <environment_name> conda install -c anaconda pipconda activate <environment_name>
conda deactivate
pip install wombat
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon">
<path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path>
直接将其安装到激活的虚拟环境中:
git clone https://github.com/WISDEM/WOMBAT.git cd wombat python setup.py installpip install .
安装完成后,可以导入包:
python import wombat wombat.__version__
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon">
<path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path>
如需进一步使用,请参阅文档站点https://wisdem.github.io/WOMBAT。
代码贡献者应该注意,有一个额外的依赖套件用于运行测试并启用预提交工作流程以自动标准化核心代码格式化原则。
git clone https://github.com/WISDEM/WOMBAT.git cd wombatpip install -e '.[dev]'
pre-commit install
pytest tests
pip install -e '.[dev]'
pre-commit install
pytest tests" tabindex="0" role="button">
用户可能遇到的基本预提交问题及其补救措施:
- 对于任何失败的运行,更改可能已自动应用或需要贡献者进行进一步编辑。无论哪种情况,做出更改后,贡献者都必须重新运行
git add <the changed files>
并git commit -m <the commit message>
重新启动应用更改的预提交工作流程。一旦所有检查通过,提交就可以安全地推送。 isort
、black
或简单文件检查失败,但进行了更改- 根据需要重新运行
add
和commit
进程,直到更改满足检查要求
- 根据需要重新运行
pylint
或flake8
失败:- 解决错误并重新运行
add
和commit
进程
- 解决错误并重新运行
mypy
有看起来不正确的类型错误- 仔细检查输入实际上是否正确,并重新运行
add
和commit
进程 - 如果
mypy
只是与看似正确的类型混淆,可以在错误上方添加以下语句mypy
:assert isinstance(<variable of concern>, <the type you think mypy should be registering>)
- 如果这仍然不起作用,但您确信类型是正确的,只需
# type ignore
在行末尾添加注释即可。有时mypy
会遇到复杂的场景,或者特别是某些attrs
约定。
- 仔细检查输入实际上是否正确,并重新运行
git clone https://github.com/WISDEM/WOMBAT.git cd wombat pip install -e '.[docs]'
pip install -e '.[docs]'" tabindex="0" role="button">
建立网站
注意 您可能需要将文件中的“execute_notebooks”参数更改
docs/_config.yaml
为“off”,除非您要更新编码示例,否则它们将在您每次构建站点时运行。
jupyter-book build docs
查看结果:docs/_build/html/index.html
git clone https://github.com/WISDEM/WOMBAT.git cd wombat pip install -e '.[all]'