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

Streamline parameter linkage #65

Merged
merged 8 commits into from
Jun 7, 2024
Merged

Conversation

dexter2206
Copy link
Contributor

This PR introduces three essential changes:

  • Changes data type of Routine.linked_params. Instead of mapping source parameters to pairs (routine, param), where routine is itself a Routine object, it now stores values of the form (path, param). This is done to facilitate detection of linkage deeper than one level without referring to routine's parent.
  • Adds a precompilation stage that converts deep linkages into a series of one-level shallow linkages. This makes the compilation process (more) routine-local, which should move us closer to removing parent backlinking (Get rid of parent backlinking #28 ).
  • Prohibits linkage of more than one level to be processed during the compilation stage, thus forcing user to either create a correctly defined routine with shallow linkages, or use an apropriate precompilation step (which is included in the defaults).

To explain what we mean by converting deep linkagkes into a series of shallow ones: suppose you have routine a, its child b and b's child c. Let a have parameter x linked to c's parameter y (i.e. a#x -> c#y). Then:

  • The original link (a#x -> c#y) is removed.
  • a#x is linked to a new input parameter b#c.y.
  • b#c.y is linked to c#y.

Naturally, the same process applies if there is more than one level of nesting.

@dexter2206 dexter2206 requested a review from mstechly June 7, 2024 16:16
@dexter2206 dexter2206 merged commit 8645d90 into main Jun 7, 2024
7 checks passed
@dexter2206 dexter2206 deleted the streamline-parameter-linkage branch June 7, 2024 16:41
This was referenced Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants