Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
15 changes: 8 additions & 7 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,33 +78,33 @@ IMPORTANT NOTES
"A complete thought. [PR XYZ]((https://github.com/NatLabRockies/H2Integrate/pull/XYZ)", where
`XYZ` should be replaced with the actual number.

## Section 3: Related Issues
## Section 4: Related Issues
<!--If this PR relates to an existing GitHub issue, please link the issue and indicate whether this PR would fully or partially resolve that issue. Please also link any issues that were created due to this PR-->


## Section 4: Impacted Areas of the Software
## Section 5: Impacted Areas of the Software
<!--
Replace the below example with any added or modified files, and briefly describe what has been changed or added, and why. Can exclude CHANGELOG.md, doc pages and supported_models.py.
-->
### Section 4.1: New Files
### Section 5.1: New Files
- `path/to/file.extension`
- `method1`: What and why something was changed in one sentence or less.

### Section 4.2: Modified Files
### Section 5.2: Modified Files
- `path/to/file.extension`
- `method1`: What and why something was changed in one sentence or less.

## Section 5: Additional Supporting Information
## Section 6: Additional Supporting Information
<!--Add any other context about the problem here.-->


## Section 6: Test Results, if applicable
## Section 7: Test Results, if applicable
<!--
Add the results from unit tests and regression tests here along with justification for any
failing test cases.
-->

## Section 7 (Optional): New Model Checklist
## Section 8 (Optional): New Model Checklist
<!-- Complete this section only if you checked "New Model" above -->
- [ ] **Model Structure**:
- [ ] Follows established naming conventions outlined in `docs/developer_guide/coding_guidelines.md`
Expand All @@ -128,6 +128,7 @@ failing test cases.
- [ ] Model added to the main models list in `docs/user_guide/model_overview.md`
- [ ] Model documentation page added to the appropriate `docs/` section
- [ ] `<model_name>.md` is added to the `_toc.yml`
- [ ] Run `generate_class_hierarchy.py` to update the class hierarchy diagram in `docs/developer_guide/class_structure.md`



Expand Down
4 changes: 3 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ build:
tools:
python: '3.11'
jobs:
pre_build: [jupyter-book config sphinx docs/]
pre_build:
- python docs/generate_class_hierarchy.py
- jupyter-book config sphinx docs/
python:
install:
- method: pip
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
- Removed a few usages of `shape_by_conn` due to issues with OpenMDAO v3.43.0 release on some computers [PR 632](https://github.com/NatLabRockies/H2Integrate/pull/632)
- Made generating an XDSM diagram from connections in a model optional and added documentation on model visualization. [PR 629](https://github.com/NatLabRockies/H2Integrate/pull/629)
- Added a storage performance baseclass model `StoragePerformanceBase` and updated the other storage performance models to inherit it [PR 624](https://github.com/NatLabRockies/H2Integrate/pull/624)
- Added an automated script to crawl through the codebase and generate a visualization of the class hierarchy in H2Integrate. [PR 643](https://github.com/NatLabRockies/H2Integrate/pull/643)
- Modified the calc tilt angle function for pysam solar to support latitudes in the southern hemisphere [PR 646](https://github.com/NatLabRockies/H2Integrate/pull/646)
- Added oxygen production metrics and as outputs to `ECOElectrolyzerPerformanceModel` [PR 642](https://github.com/NatLabRockies/H2Integrate/pull/642)
- Bugfix to allow for one resource to be connected to multiple technologies [PR 655](https://github.com/NatLabRockies/H2Integrate/pull/655)
Expand Down
2 changes: 2 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ sphinx:
# class-doc-from
# no-value
autodoc_typehints: description
html_static_path:
- _static
napoleon_use_admonition_for_notes: true
napoleon_use_rtype: false
nb_merge_streams: true
Expand Down
497 changes: 497 additions & 0 deletions docs/_static/class_hierarchy.html

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/build_book.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
rm -rf _build

# Generate the interactive class hierarchy diagram
python generate_class_hierarchy.py

jupyter-book build --keep-going .
27 changes: 25 additions & 2 deletions docs/developer_guide/class_structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,29 @@ Let us take a PEM electrolyzer model as an example.
Each electrolyzer model has shared methods and attributes that would be present in any valid model.
These methods are defined at the `ElectrolyzerBaseClass` level, which inherits from `ConverterBaseClass`.
Any implemented electrolyzer model should inherit from `ElectrolyzerBaseClass` to make use of its already built out structure and methods.
This is shown below.

![Class structure](fig_of_class_structure.png)
## Interactive class hierarchy

The diagram below shows **every model class** in H2Integrate and how they inherit from one another.
The visual encoding uses three dimensions:

- **Color** represents the application group (electricity, chemical, metal, etc.)
- **Shape** represents the model category (converter, storage, transporter, etc.)
- **Border thickness** indicates inheritance depth (thicker borders = higher-level parent classes)

Arrows point from parent to child.
You can **zoom**, **pan**, **hover** for details, and **drag** nodes to rearrange the layout.

To regenerate this visualization after code changes, run:

```bash
python docs/generate_class_hierarchy.py
```

```{raw} html
<div style="width:100%; box-sizing:border-box;">
<iframe src="../_static/class_hierarchy.html" width="100%" height="950px"
style="border:1px solid #ccc; border-radius:8px;"
allowfullscreen></iframe>
</div>
```
Loading
Loading