[DEFERRED] Use Editor API for calc def body (inputs + return expression) once upstream ships

Aperta
#17 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
20/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
jupyter-notebook, python
Ambito
documentation

Direzione di ricerca

This work is explicitly deferred until the upstream Editor API supports calc-def input parameters and return expressions. Start by checking the referenced OpenSysML API issue once it is filed, then inspect the tutorial code that uses DELIVERED_ENERGY_IN_POWER, DELIVERED_ENERGY_IN_DUR, DELIVERED_ENERGY_IN_EFF, and DELIVERED_ENERGY_RETURN. Done means replacing those fragment variables with the corresponding API calls and preserving the tutorial's parameter sweep.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Context

The opensysml v0.9.0 parser accepts this construct:

```sysml
package P {
private import ISQ::;
private import MeasurementReferences::
;
calc def DeliveredEnergy {
in power : ISQ::PowerValue;
in duration : ISQ::DurationValue;
in efficiency : MeasurementReferences::DimensionOneValue;
return : ISQ::EnergyValue = power * duration * efficiency;
}
}
```

Probing (2026-09-25): editor.add_calc_def(owner, name) produces only calc def DeliveredEnergy;
— a bare declaration with no in-parameters and no return expression. The body is not expressible
via the API.

The body (typed inputs + return expression) is the pedagogically essential part of this construct:
it defines the functional relationship the tutorial's parameter sweep evaluates.

Spec reference

SysML v2 Language Specification formal/2026-03-02, clause 7.16 (CalculationDefinition —
CalculationBody, ReturnParameterMembership, OwnedParameterMembership with in direction,
ResultExpressionMembership)

Current workaround

```python

calc def body not yet supported in Editor API — toaster#17 / OpenSysML#TBD

spec: SysML v2 formal/2026-03-02 §7.16 (CalculationDefinition, ReturnParameterMembership)

DELIVERED_ENERGY_IN_POWER = " in power : ISQ::PowerValue;"
DELIVERED_ENERGY_IN_DUR = " in duration : ISQ::DurationValue;"
DELIVERED_ENERGY_IN_EFF = " in efficiency : MeasurementReferences::DimensionOneValue;"
DELIVERED_ENERGY_RETURN = " return : ISQ::EnergyValue = power * duration * efficiency;"
```

Upstream issue

Open-MBEE/OpenSysML#TBD (to be filed)

Resolution

When the Editor API supports in-parameters and return expressions on calc defs, replace each
fragment variable with the corresponding API call.

Lingua principale
Jupyter Notebook
Stelle
0
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Open-MBEE/toaster

Tutte le issue di Open-MBEE/toaster

Issue simili

Altre issue su Documentation

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.