Skip to content

chore/SOF 7921#147

Closed
VsevolodX wants to merge 22 commits into
mainfrom
chore/SOF-7921
Closed

chore/SOF 7921#147
VsevolodX wants to merge 22 commits into
mainfrom
chore/SOF-7921

Conversation

@VsevolodX

Copy link
Copy Markdown
Member
  • update: adjust {} -> []
  • update: tests:


merged_context = self._merge_convergence_context(
unit_for_convergence.context,
{item["name"]: item["data"] for item in unit_for_convergence.context},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You should update the _merge_convergence_context function instead

):
reciprocal_vector_ratios = PointsGridDataProvider(
context=unit_for_convergence.context
context={item["name"]: item["data"] for item in unit_for_convergence.context}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This doesn't make sense - we should initialize it with context from unit_for_convergence directly, as it was

Comment thread src/py/mat3ra/wode/units/unit.py Outdated
next: Flowchart ID of the next unit
tags: List of tags for the unit
context: Context data dictionary for the unit
context: Persisted context provider items for the unit

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Persistent

):
target_unit = self.get_unit_by_name(name=unit_name, name_regex=unit_name_regex)
target_unit.context = new_context
target_unit.set_context(new_context or [])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Having set_context also should not be needed

def _instantiate_model(cls, value: Any) -> Any:
if isinstance(value, Model):
return value
return ModelFactory.create(value.to_dict())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This doesn't make sense

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

IT is to create ModelDFT or Model based on the config
SerializeAsAny[Model] accepts any config that is bound by Model, and here we return it

Comment thread tests/py/test_workflow.py
f"execution unit {unit.get('name')!r} must include application for web-app ExecutionUnit"
)
if subworkflow_application:
assert unit["application"].get("name") == subworkflow_application.get("name")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We shouldn't need these

Comment thread src/py/mat3ra/wode/units/execution.py Outdated
data = value
if name is None:
raise ValueError("yield_data() must contain a provider data key")
return ExecutionUnit.context_item(name, data, is_edited=is_edited, extra_data=extra_data)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The implementation should be simpler. Dealing with context item serialization should be in a class of its own; the list of context items should have its own logic

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.

2 participants