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

Refactor python engines api #14940

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft

Conversation

pinzart90
Copy link
Contributor

Purpose

(FILL ME IN) This section describes why this PR is here. Usually it would include a reference to the tracking task that it is part or all of the solution for.

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB

Release Notes

(FILL ME IN) Brief description of the fix / enhancement. Mandatory section

Reviewers

(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)

(FILL ME IN, optional) Any additional notes to reviewers or testers.

FYIs

(FILL ME IN, Optional) Names of anyone else you wish to be notified of

Copy link

github-actions bot commented Feb 14, 2024

UI Smoke Tests

Test: success. 2 passed, 0 failed.
TestComplete Test Result
Workflow Run: UI Smoke Tests
Check: UI Smoke Tests - net8.0

@pinzart90
Copy link
Contributor Author

pinzart90 commented Feb 14, 2024

@mjkkirschner
Copy link
Member

@aparajit-pratap @mjkkirschner It looks like the API break check does not catch this change https://github.com/DynamoDS/Dynamo/pull/14940/files#diff-62203096f02fa171470a1ae45e23936dd6808ac8fc2aae936ef968d43675b057L119-R122 Should it ?

no, @aparajit-pratap only added files for DynamoCore I think and we have yet to move any members to the shipped list. We need to schedule work to make use of this new system. We also need to decide about using warnings as errors.
@jasonstratton FYI.

/// Use this function to customize Python engine initialization.
/// This function will be called only once on all existing or future python engines (on PythonEngineAdded).
/// </summary>
public Action<PythonEngine> CustomizeEngine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems kind of dangerous, I imagine you want integrations like Revit to use this to setup marshallers and hook up events?

But this would also be easily accessible to anyone since this class has a static instance method - it could easily break python integration.


/// <summary>
/// Use this function to customize Python engine initialization.
/// This function will be called only once on all existing or future python engines (on PythonEngineAdded).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment is a bit misleading as this setter has the side effect of calling the method...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I kind of don't like a setter doing more than just replacing a value,
Still not convinced this is the proper way to go...

/// <summary>
/// Event that is triggered for every engine that is removed.
/// </summary>
public static PythonEngineChangedHandler PythonEngineRemoved;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how do you imagine removal will work? Just remove the instance from the list of engines or actually try to unload it?

Copy link
Contributor Author

@pinzart90 pinzart90 Feb 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With ALCs, I would imagine completely unloading it (assuming it works for python runtime)

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.

None yet

3 participants