Skip to content

Allow a model history parent to be set.#475

Merged
luciansmith merged 2 commits intodevelopmentfrom
modelhistory-parent
Mar 11, 2026
Merged

Allow a model history parent to be set.#475
luciansmith merged 2 commits intodevelopmentfrom
modelhistory-parent

Conversation

@luciansmith
Copy link
Member

Also, set the parent correctly when adding one to an existing element.

Found a bug in Antimony where I would copy a ModelHistory object from one document to another, and it came with its old parent, which would often be deleted. However, there was no way for me to unset the parent of a ModelHistory, so this fixes that.

Also, set the parent correctly when adding one to an existing element.
Copy link
Member

@fbergmann fbergmann left a comment

Choose a reason for hiding this comment

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

@luciansmith great catch! I agree that the SBase change, definitely should go in.

the new 'connectToParent' method, i'm not so sure about. We have the function to set the parent object. And ModelHistory is not an SBase derived class (or an SBML object), so I would find the method there confusing. Would you be fine with just the sbase change getting in?

@luciansmith
Copy link
Member Author

The other method is private, so I can't call it from Antimony. Originally I just made it public, but looking at other classes, 'connectToParent' was the function we usually used.

I would be fine with either the current change, or the other parent-related functions being made public instead of protected!

@fbergmann
Copy link
Member

@luciansmith lets make the isSet/get/set/unset ParentObject methods public! That would be even better than the connectToParent

Copy link
Member

@fbergmann fbergmann left a comment

Choose a reason for hiding this comment

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

thanks a lot

@luciansmith luciansmith merged commit a0ce444 into development Mar 11, 2026
35 checks passed
@luciansmith luciansmith deleted the modelhistory-parent branch March 11, 2026 19:43
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