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

Store arrays in model parameters as arrays and not as strings to simplify code. #1317

Closed
GernotMaier opened this issue Jan 22, 2025 · 1 comment · Fixed by #1466
Closed

Comments

@GernotMaier
Copy link
Contributor

Arrays are stored in the model parameters typically as strings, similar to the way sim_telarray is doing it.

Example:

{
    "schema_version": "0.2.0",
    "parameter": "telescope_transmission",
    "instrument": "LSTN-design",
    "site": "North",
    "parameter_version": "1.0.0",
    "unique_id": null,
    "value": "0.969 0.0 0.0 0.0 0.0 0.0",
    "unit": "null, null, null, null, null, null",
    "type": "float64",
    "file": false
}

This requires multiple string-to-list and list-to-string conversion in the code (general.convert_string_to_list and gen.convert_list_to_string.). I suggest that we store arrays as arrays (meaning above would be stored as [0.969, 0.0, 0.0, 0.0, 0.0, 0.0]) and we do only once a conversion to strings: when writing the sim_telarray configuration files.

@GernotMaier
Copy link
Contributor Author

A first step to address this issue is to convert all string-like arrays in the model repository / database, see gitlab merge request.

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 a pull request may close this issue.

1 participant