Skip to content

Commit 23708c7

Browse files
authored
Allow Python subclassing of ComponentGraphConfig and ComponentGraph (#36)
2 parents 56c6fc7 + c5ee356 commit 23708c7

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
# Frequenz Microgrid Component Graph Library Release Notes
22

3-
## Summary
4-
5-
<!-- Here goes a general summary of what this release is about -->
6-
7-
## Upgrading
8-
9-
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
10-
113
## New Features
124

13-
<!-- Here goes the main new features and examples or instructions on how to use them -->
14-
15-
## Bug Fixes
16-
17-
<!-- Here goes notable bug fixes that are worth a special mention or explanation -->
5+
- It is now possible to create subclasses of the `ComponentGraph` and `ComponentGraphConfig` classes from python.

src/graph.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use pyo3::{
1616
types::{PyAny, PySet, PyType},
1717
};
1818

19-
#[pyclass]
19+
#[pyclass(subclass)]
2020
#[derive(Clone, Default, Debug)]
2121
pub struct ComponentGraphConfig {
2222
config: cg::ComponentGraphConfig,
@@ -49,7 +49,7 @@ impl ComponentGraphConfig {
4949
}
5050
}
5151

52-
#[pyclass]
52+
#[pyclass(subclass)]
5353
pub struct ComponentGraph {
5454
graph: cg::ComponentGraph<Component, Connection>,
5555
}

0 commit comments

Comments
 (0)