Skip to content
Snippets Groups Projects
Commit 806f9d18 authored by David Hendriks's avatar David Hendriks
Browse files

updated the docs of the grid options and the stellar types

parent 04857ec7
No related branches found
No related tags found
No related merge requests found
""" """
Module that contains the default options for the population grid code, Module that contains the default options for the population grid code along with the description for these options, in the form of dictionaries:
- grid_options_defaults_dict: dictionary containing the default values for all the options
- grid_options_descriptions: dictionary containing the description for these options.
along with a dictionary containing descriptions for each of the parameters, and some utility functions: There are several other functions in this module, mostly to generate help texts or documents:
- grid_options_help: interactive function for the user to get descriptions for options - grid_options_help: interactive function for the user to get descriptions for options
- grid_options_description_checker: function that checks that checks which options have a description. - grid_options_description_checker: function that checks that checks which options have a description.
- write_grid_options_to_rst_file: function to generate the .rst document for the docs
With this its also possible to automatically generate a pdf file containing all the setting names + descriptions. With this its also possible to automatically generate a pdf file containing all the setting names + descriptions.
...@@ -472,9 +475,13 @@ grid_options_descriptions = { ...@@ -472,9 +475,13 @@ grid_options_descriptions = {
# Grid options functions # Grid options functions
# Utility functions # Utility functions
def grid_options_help(option): def grid_options_help(option: str) -> str:
""" """
Function that returns the description of a grid option Function that prints out the description of a grid option. Useful function for the user.
Args:
option: which option you want to have the description of
""" """
option_keys = grid_options_defaults_dict.keys() option_keys = grid_options_defaults_dict.keys()
...@@ -489,14 +496,22 @@ def grid_options_help(option): ...@@ -489,14 +496,22 @@ def grid_options_help(option):
else: else:
print(grid_options_descriptions[option]) print(grid_options_descriptions[option])
def grid_options_description_checker(print_info=True): def grid_options_description_checker(print_info: bool=True) -> int:
""" """
Function that checks which descriptions are missing Function that checks which descriptions are missing
Args:
print_info: whether to print out information about which options contain proper descriptions and which do not
Returns:
the amount of undescribed keys
""" """
# Get the keys
option_keys = grid_options_defaults_dict.keys() option_keys = grid_options_defaults_dict.keys()
description_keys = grid_options_descriptions.keys() description_keys = grid_options_descriptions.keys()
#
undescribed_keys = list(set(option_keys)-set(description_keys)) undescribed_keys = list(set(option_keys)-set(description_keys))
if undescribed_keys: if undescribed_keys:
...@@ -505,11 +520,15 @@ def grid_options_description_checker(print_info=True): ...@@ -505,11 +520,15 @@ def grid_options_description_checker(print_info=True):
print("Total description progress: {:.2f}%%".format(100 * len(description_keys)/len(option_keys))) print("Total description progress: {:.2f}%%".format(100 * len(description_keys)/len(option_keys)))
return len(undescribed_keys) return len(undescribed_keys)
def write_grid_options_to_rst_file(output_file): def write_grid_options_to_rst_file(output_file: str) -> None:
""" """
Function that writes the descriptions of the grid options to a rst file Function that writes the descriptions of the grid options to a rst file
TODO: seperate things into private and public options Tasks:
TODO: seperate things into private and public options
Args:
output_file: target file where the grid options descriptions are written to
""" """
# Get the options and the description # Get the options and the description
......
""" """
Module containing stellar type dicts Module containing two stellar type dicts:
- STELLAR_TYPE_DICT: dictionary with long names
- STELLAR_TYPE_DICT_SHORT: dictionary with short names/abbreviations
""" """
STELLAR_TYPE_DICT = { STELLAR_TYPE_DICT = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment