Skip to content
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

Explicit interface for obtaining and managing system result designs #360

Open
rfahlberg opened this issue Nov 25, 2024 · 2 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@rfahlberg
Copy link
Collaborator

rfahlberg commented Nov 25, 2024

📝 Description of the feature

Currently, users need to do oSL Server API based scripting to obtain system result designs, like:

from ansys.optislang.core import Optislang
from ansys.optislang.core.tcp.osl_server import TcpOslServer
from pprint import pprint

osl = Optislang(host="127.0.0.1", port=5310)
osl.timeout = 600
osl_server: TcpOslServer = osl.osl_server

sensi = osl.application.project.root_system.find_nodes_by_name("Sensitivity")[0]

actor_status_info=osl_server.get_actor_status_info(sensi.uid, "0", include_designs=True, include_design_values=True)

# design_status contains (status) info like
# - id
# - status
# - pareto_design
# - feasible
# for each design 
design_status=actor_status_info['design_status']

# designs contains the actual designs (values)
designs=actor_status_info['designs']

This should be supported directly as explicit API of the ParametricSystem node.

Users should be able to obtain:

  • result design status info only (status, feasibility, pareto flag, ...)
  • the full result design container, optionally including values, non scalar values, ... , (see get_actor_status_info method attributes)
  • single designs per HID (see result_design method)

A DesignManager class should be added, to wrap the interface/data. This class should also manage the functionality for saving designs as local file.

Adapt the workflow creation examples to include obtaining result design.

💡 Steps for implementing the feature

No response

🔗 Useful links and references

No response

@rfahlberg rfahlberg added the enhancement New feature or request label Nov 25, 2024
@PanekOndrej
Copy link
Collaborator

PanekOndrej commented Jan 13, 2025

I propose to return designs in format of Design class, which was previously created exclusively for RootSystem, but contains all requested properties except pareto_design. We can extend it for pareto_design property and keep it optional (True/False/None).

Few issues with implementation:

  • single result_design query doesn't contain pareto_design information.
  • input parameter include_non_scalar_design_values of actor_status_info query doesn't work

Can I proceed with implementation using Design class @rfahlberg ?

@PanekOndrej
Copy link
Collaborator

List of changes:

  • DesignManager class was created
    -get_designs(hid: str, include_design_values: bool=True) -> Tuple[Design] using get_actor_status_info query
    • get_design(hid: str) -> Design using get_result_design query
    • save_designs_as_xxx methods moved from RootSystem and modified:
      • Method TcpRootSystemProxy._get_designs_dicts querying all available states and then sorting by id not used.
      • Only requested hid is querried and designs kept as provided.
  • RootSystem class:
    • methods save_designs_as_xxx marked as deprecated but left unchanged
  • Design class was extended with pareto_design property

Issues:

  • actor_status_info query lacks additional arguments in online help
  • get_result_design response doesn't include pareto flag
  • Argument include_non_design_scalar_values of get_actor_status_info doesn't work

TODO:

  • documentation
  • tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants