Repository navigation
Migrating from 0.5.x
Version 1.0.0 is a ground-up rewrite. The 0.5.x line was a hand-maintained textX/astropy/PyYAML parser; 1.0.0 is a purely-generated, pure-standard-library library. See the README for the full story. This page is the practical "what do I change in my code?"
For the complete, authoritative migration note, read
migration-0.5-to-1.0.md
in the sysml2py-lab repo.
- Engine: textX-backed parser → generated AST/builder library.
-
No runtime deps:
pip install sysml2pynow pulls only the standard library. The old line bundled astropy; 1.0.0 does not. - Provenance: every install records the generating inputs (see Provenance).
-
Upgrade
pip install -U sysml2py
-
Units / astropy: if you used
astropy.unitsor units in attributes, addastropyto your own project deps andimport astropy.units as uwhere needed. It is no longer bundled. -
Builder API: the friendly names you remember are preserved —
Part,Attribute,Item,Port— but theBuilder/Usage/Definitionsuffixes are dropped. Usage vs. definition is now chosen at creation:Part('Stage_1') # part Stage_1; Part('Stage_1', kind='definition') # part def Stage_1;
add()appends children (pkg.add(part)). Container names that collide with AST node classes keep the*Buildersuffix (PackageBuilder, etc.), and definition-less kinds rejectkind='definition'with aValueError. -
set_valueis gone: passvalue=/unit=to the builder constructor instead:# 0.5.x a = Attribute()._set_name('mass') a.set_value(100 * u.kg) # 1.0.0 Attribute('mass', value=100, unit='kg')
If a 0.5.x behaviour is genuinely missing, pin <1.0.0 and file the gap on
the sysml2py-lab repo — it is generator error, not a license to
hand-edit the generated library.