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

Add interface / convenience functionality concerning result file handling needed by SAF #155

Closed
3 tasks
rfahlberg opened this issue Jul 26, 2023 · 7 comments · Fixed by #166
Closed
3 tasks
Assignees
Labels
enhancement New feature or request

Comments

@rfahlberg
Copy link
Collaborator

rfahlberg commented Jul 26, 2023

📝 Description of the feature

  • To ParametricSystem wrapper class, add interface / convenience functionality to
    • Obtain path to result OMDB file (resemble functionality of OWS "/omdb" endpoints)
    • Generate and store a CSV/Json file containing result designs
  • To Node wrapper class, add functionality to
    • Obtain information about node result files:
      • Path on filesystem
      • Registered file ID and Comment
      • Status (exists or not)
      • File size
      • Last modified
  • To Project wrapper class, add functionality to
    • Obtain information about project result files:
      • Path on filesystem
      • Registered file ID and Comment
      • Status (exists or not)
      • File size
      • Last modified

Effort estimation: 1PW

💡 Steps for implementing the feature

No response

🔗 Useful links and references

According tasks in SAF:

@rfahlberg rfahlberg added the enhancement New feature or request label Jul 26, 2023
@rfahlberg
Copy link
Collaborator Author

@asbfall @iazehaf FYI

@rfahlberg
Copy link
Collaborator Author

@sebastian-wolff FYI

@PanekOndrej PanekOndrej self-assigned this Aug 7, 2023
@PanekOndrej
Copy link
Collaborator

Hi Ronny, could you please clarify, what exactly you mean by result files? Do you mean registered files that I can obtain by basic_project_info query for the project? For nodes I can then use get_actor_info to obtain uids of registered files associated with individual nodes and filter whole list obtained by basic_project_info.

@rfahlberg

@rfahlberg
Copy link
Collaborator Author

@PanekOndrej Yes, exactly. The "result files" are the centrally registered files, which are set to { "usage": "Output file" }. The global list can be obtained using "basic_project_info". If a registered file is not associated to (use by) a certain node, it should be accessible via pyosl "Project" interface. If a registered file is associated to (use by) a certain node, it should be accessible via pyosl "Node" interface. For nodes you can use get_actor_info to obtain uids of used registered files.

@PanekOndrej
Copy link
Collaborator

PanekOndrej commented Aug 16, 2023

I implemented requested functionality and linked a branch to this issue.

  • Regarding designs, I implemented:

    • Node wrapper class's public method get_states_ids() -> Tuple[str]
    • ParametricSystem wrapper class's methods:
      • private method _get_designs_dicts() -> OrderedDict returning designs of all available states for given parametric system (sorted by state hid key)
      • public method get_omdb_files() -> Tuple[File]
      • public method save_designs_as(hid: str, file_name: str, format: FileOutputFormat = FileOutputFormat.JSON, dir: Union[Path, str] = None) -> File
      • *File object contains file's path and convenience functionality to get info about the file
    • We may create public method get_designs() that would return object DesignCollection (or sth like that), that would contain individual designs (Design class, that is already implemented could be used for this) and methods to work with these design
      resembling OWS functionality (number of succeeded designs, processed designs etc.).
  • Regarding result files, both Node (and it's subclasses) and Project wrappers have methods get_registered_files() and get_result_files -> Tuple[RegisteredFile], which is a object with properties returning requested info.

I think this should do it, please let me know if there are any issues with implementation. Otherwise I'd like to create unit tests and then it should be ready for merge into main branch.

@rfahlberg

@rfahlberg
Copy link
Collaborator Author

@PanekOndrej looks very good to me. Please go ahead with unit tests and PR.

@rfahlberg
Copy link
Collaborator Author

@iazehaf Please confirm the additions are sufficient for SAF.

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

Successfully merging a pull request may close this issue.

2 participants