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

Improve reading of design models; refactoring and improved docstrings for simtools.utils.names #1396

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

GernotMaier
Copy link
Contributor

@GernotMaier GernotMaier commented Feb 24, 2025

simtools.utils.names is one of the simtools base classes, but grew over the past months and was therefore a bit more difficult to understand.

This PR tries to improve docstrings and naming plus applies some minor refactoring to names.py. Also added a more extended module docstring to explain a bit better the differences between the different named items.

In detail:

  • load_model_parameters() --> _load_model_parameters() now private; improve efficiency by reading all files only once
  • name change: all_model_parameters() --> model_parameters()
  • name change: get_array_element_name_from_type_site_id()-->generate_array_element_name_from_type_site_id`
  • removed guess_design_model_from_name() not used anywhere (and wrong response for MSTS/MSTN)
  • removed get_parameter_name_from_simtel_name() not used anywhere
  • removed layout_telescope_list_file_name() not used anywhere
  • added a function called is_design_type(array_element_name) to check if a given array element is a design element (e.g. is LSTN-design)

Improved and corrected also reading of design models for a given array element type (this triggered the improvement of the documentation; I didn't understand some functions in names.py).

Closes #1391.

This comment has been minimized.

2 similar comments

This comment has been minimized.

This comment has been minimized.

Base automatically changed from flash-and-nectarcam to main February 24, 2025 12:59

This comment has been minimized.

1 similar comment
Copy link

Passed

Analysis Details

0 Issues

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 0 Code Smells

Coverage and Duplications

  • Coverage 95.80% Coverage (94.20% Estimated after merge)
  • Duplications 0.00% Duplicated Code (0.00% Estimated after merge)

Project ID: gammasim_simtools_AY_ssha9WiFxsX-2oy_w

View in SonarQube

@GernotMaier GernotMaier marked this pull request as ready for review February 24, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Getting / guessing design model from array element name requires update
1 participant