Replies: 6 comments 4 replies
-
Hi @andibarg, Thank you for adressing this topic. I think improvements can indeed be made on this side. To reflect on your points: 1. Embedding
|
Beta Was this translation helpful? Give feedback.
-
Hi @LucVV, Yes, that sounds great. It seems that for |
Beta Was this translation helpful? Give feedback.
-
Hi again, I implemented some the changes to this and uploaded pull request #26. Indeed, I can now initialize ZOSpy with just two lines: import zospy as zp
zos = zp.ZOS()
oss = zos.create_new_application() With the few tests I have done so far, I could not see anything breaking. It is even backward compatible, meaning that the four lines mentioned above still work to initialize ZOSpy (without another assert in the main script to check connection). Note that I included asserts for the connections in I have not run a unit test, since I am currently trying to wrap my head around that :). Let me know what you think. Edit: Corrected example code |
Beta Was this translation helpful? Give feedback.
-
This has been implemented in a backwards-compatible manner in #26. Initializing ZOSPy can now be done with import zospy as zp
zos = zp.ZOS()
oss = zos.create_new_application(return_primary_system=True) In the next major version, this will become the only way to initialize ZOSPy. |
Beta Was this translation helpful? Give feedback.
-
Looking back, I am afraid we didn't put enough thought into this and focused too much on the current situation. A cleaner solution would be to create a new The problem is: we did already release these changes. Nevertheless, implementing it this way still results in a smoother transition to the simplified initialization of ZOSPy. It may also make the API a bit cleaner, by merging three connection methods (which differ by only a single line) into one. I would like to hear your opinions about this. Do the possible advantages of this implementation outweigh the disadvantages of introducing another (for now non-breaking) change in the API? |
Beta Was this translation helpful? Give feedback.
-
This has been implemented in #62 and just released with ZOSPy 1.2.0! |
Beta Was this translation helpful? Give feedback.
-
Hi all,
At the moment as many as four lines (apart from import) are needed to initialize ZOSPy:
I was wondering if it has to be this way. Could
zos.wakeup()
not be called automatically when creating the instance viazos = zp.ZOS()
? I think everyone wants to do that anyways, right? Same goes forzos.connect_as_extension()
andzos.create_new_application()
- why can they not return the primary systemoss
right away?If there is an opportunity to turn four lines of code into two, I would take it :). What do you think?
Beta Was this translation helpful? Give feedback.
All reactions