v2.0.0 #137
crnh
announced in
Announcements
v2.0.0
#137
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
A new major release: ZOSPy v2!
This release contains a lot of changes under the hood, making ZOSPy more reliable and easier to extend.
For example, it is now easier to develop new analyses.
This release also removes a few deprecated functions.
As a result, some of the changes are not backwards compatible with older ZOSPy versions.
Backwards-incompatible changes
new_analysishas asettings_firstargument that allows to change the analysis settings before running them. These arguments are now keyword-only.new_analysis(<AnalysisType>, True)does not work anymore; usenew_analysis(<AnalysisType>, settings_first=True)instead. Here's a list of the impacted functions:zospy.analyses.new.new_analysis:settings_firstis now a keyword-only argument.zospy.api.apisupport.load_zosapi_nethelper:preloadis now a keyword-only argument.zospy.api.apisupport.load_zosapi:preloadis now a keyword-only argument.zospy.functions.lde.find_surface_by_comment:case_sensitiveis now a keyword-only argument.zospy.functions.nce.find_object_by_comment:case_sensitiveis now a keyword-only argument.zospy.utils.flatten_dict:keep_unflattenedis now a keyword-only argument.zospy.zpcore.OpticStudioSystem.load:saveifneededis now a keyword-only argument.zospy.zpcore.OpticStudioSystem.new:saveifneededis now a keyword-only argument.zospy.zpcore.OpticStudioSystem.close:saveifneededis now a keyword-only argument.zospy.zpcore.ZOS.__init__: all parameters are now keyword-only arguments.zospy.zpcore.ZOS.wakeup,zospy.zpcore.ZOS.connect_as_extension,zospy.zpcore.ZOS.create_new_applicationandzospy.zpcore.ZOS.connect_as_standalonehave been removed. For more information, see New connection methodszospy.functions.nce.get_object_datahas been removed because it implements a conversion that is now done automatically byzospy.api.codecs.OpticStudioInterfaceEncoder.New connection methods
A new connection method
ZOS.connecthas been introduced in ZOSPy 1.2.0.All other connection methods (
connect_as_extension,create_new_applicationandconnect_as_standalone) have been removed.New analysis interface
The analysis interface has been rewritten and is now object oriented.
In general, an analysis that was previously run this way:
now has to be run this way:
For more information about the new interface, see the documentation.
The old interface contained a lot of duplicate code, which has been solved in the new interface.
As a result, developing new analyses is a lot easier now.
Furthermore, the new interface provides a unified way to parse analysis text output.
Parsers are written in lark, and because ZOSPy provides predefined parsers for common constructs in the OpticStudio output, they can be quite concise. For example, this is the parser for the cardinal points analysis:
Improved documentation
We have largely rewritten and extended the documentation. Check it out at zospy.readthedocs.io!
Improved development workflow
ZOSPy now uses Hatch for project management.
Hatch provides a unified interface for all development-related tasks, such as testing, formatting, building documentation, generating test reference data etc.
Furthermore, it can manage Python interpreters, so unit tests can be run for all Python versions without having to install all interpreters manually.
Read more in our contributing guidelines
Contributors
This discussion was created from the release v2.0.0.
Beta Was this translation helpful? Give feedback.
All reactions