Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fluent interface kernel session #2437

Merged
merged 2 commits into from
Dec 18, 2023

Conversation

mwdchang
Copy link
Member

Summary

This PR handles two things:

  • Instead of returning null if kernel-session-manager's sendMessage fails, throw an error. This makes the fluent interface a bit less gnarly to read. Instead of sendMessage(...)?.register, now it is just sendMessage(...).register

  • I noticed we send a lot of extra, unneeded messages (e.g. reset) for model-edit, this cleans them up

Testing

No functional changes, can test with one or more operators that leverages the kernel session manager.

For model-edit:

  • pipe in a model to model-edit operator,
  • in the notebook we can override with an empty mira-model-template
# Define an empty model as basis
model = TemplateModel(
	templates = [],
	parameters = {},
	initials = {},
    observables = {},
	time = Time(name = "t", units = None),
	annotations = Annotations(name = "PetriNet model created by a user"))

For code-to-mode:

  • create a code-to-model operator
  • select julia, select deapodes
  • run the following code
  C::Form0{X}
  dC::Form1{X}

  dC == d₀{X}(C)

@mwdchang mwdchang merged commit 6ea8c99 into main Dec 18, 2023
5 checks passed
@mwdchang mwdchang deleted the fix-fluent-interface-kernel-session branch December 18, 2023 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants