-
Notifications
You must be signed in to change notification settings - Fork 1
Implement recursive copying helper #563
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
Conversation
a6186f0 to
a300d54
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #563 +/- ##
==========================================
+ Coverage 93.06% 93.31% +0.25%
==========================================
Files 82 84 +2
Lines 4297 4445 +148
==========================================
+ Hits 3999 4148 +149
+ Misses 298 297 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
eeb6c05 to
c2a986b
Compare
151a17e to
e6e443b
Compare
roosre
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work.
Please look at my questions and comments.
FYI: A reverse dependency graph lookup would be very helpful as well. For instance where is Fabric XY used? Or with which objects is OSS XZ linked? But that can be addressed in a separate PR.
ccec699 to
435df2a
Compare
0597b6d to
82f0ed9
Compare
Co-authored-by: René Roos <105842014+roosre@users.noreply.github.com>
9c9e0ff to
5525c3d
Compare
|
@roosre I have implemented the discussed changes to the interface of the On the implementation side, the main change was using the |
60e2bec to
2222235
Compare
6deb448 to
211b8ba
Compare
211b8ba to
9a3d478
Compare
Implement a
recursive_copyhelper function, which:a dict mapping old parent to new parent [1]
Adds a dependency on
networkx, for computing theorder in which objects should be stored s.t. all their
dependencies (parent, linked objects) are already stored.
We may reuse the dependency graph produced for this
task in other contexts.
Note that the copy operation may fail if a linked object is present
in the API layer, but not supported by PyACP yet. In this case,
the linked object is still detected (since this is done by iterating through
the protobuf object), but the object cannot be instantiated.
I think this is acceptable, as it's a temporary problem and may be more
desirable than silently losing the link.
Other changes:
.clone()method to the edge property lists. This wasused in the initial implementation of this features. Since it's
consistent with the API of other objects, the method is kept.
Each edge property list type separately implements
.clone(). [2].parentproperty to tree objects, which instantiates / getsthe parent via its resource path
and distinguish them (by Python version and server version) using
flags.
[1] more than one new parent may be needed, for example
when copying a Modeling Ply (parent: Modeling Group) which
links to a Fabric (parent: Model).
[2] in general, the
GenericEdgePropertyTypeclasses have alot of code duplication; this can be dealt with in a later PR (not
urgent).