Skip to content

Conversation

@villelaitila
Copy link
Contributor

Generalizer removes elements in the model beyond given depth level parameter, so that the associations get transferred to the most closest remaining ancestor element.

@villelaitila villelaitila requested a review from NotMixu January 10, 2025 11:35
Copy link
Contributor

@NotMixu NotMixu left a comment

Choose a reason for hiding this comment

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

Looks good to me, pointed out some minor things.

Comment on lines 36 to 37
have_element_attrs = True
have_dep_attrs = False
Copy link
Contributor

Choose a reason for hiding this comment

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

These values are never changed. Is that intentional?

return generalized_model


def copy_model_and_build_map(LEVEL, generalized_model, model, have_element_attrs):
Copy link
Contributor

Choose a reason for hiding this comment

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

Could add type hints here, even though it is utility function not directly used by the user.

generalized_model = SGraph()
old_to_old = {}

def recuse_elements(elem, level, last_element_on_desired_level):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a typo?

@villelaitila villelaitila force-pushed the You_will_pass_away_very_quickly branch from 0af93ea to da2e33b Compare January 10, 2025 12:13
@softagram-bot
Copy link

Looking good 🎉

See the full Softagram report

@villelaitila villelaitila merged commit 1c09654 into softagram:main Jan 10, 2025
1 check passed
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