pyXDSM icon indicating copy to clipboard operation
pyXDSM copied to clipboard

Make systems/inputs/outputs/connections editable

Open lukasmu opened this issue 1 year ago • 7 comments

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 and black 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 with clang-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

lukasmu avatar Nov 30 '22 17:11 lukasmu