pyXDSM
pyXDSM copied to clipboard
Make systems/inputs/outputs/connections editable
Purpose
The goal of this PR is to make systems, inputs, outputs, and connections editable. This makes it possible to generate an initial XDSM and afterwards similar XDSMs with some changes.
Example
from pyxdsm.XDSM import XDSM, FUNC, LEFT
x = XDSM()
f = x.add_system("F", FUNC, "F")
g = x.add_system("G", FUNC, "G")
c = x.connect("F", "G", "x, y")
f_out = x.add_output("F", "f^*", side=LEFT)
g_out = x.add_output("G", "g^*", side=LEFT)
x.write("initial")
f.label = 'F_{new}'
f_out.label = 'f^*, z'
g.faded = True
g_out.faded = True
c.faded = True
x.write("new")
Initial: | New: |
Expected time until merged
Not urgent. Whenever you like.
Type of change
- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (non-backwards-compatible fix or feature)
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no API changes)
- [ ] Documentation update
- [ ] Maintenance update
- [ ] Other (please describe)
Testing
See example above.
Checklist
- [x] I have run
flake8
andblack
to make sure the Python code adheres to PEP-8 and is consistently formatted - [ ] I have formatted the Fortran code with
fprettify
or C/C++ code withclang-format
as applicable - [x] I have run unit and regression tests which pass locally with my changes
- [x] I have added new tests that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation