Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
binary_c-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Izzard, Robert Dr (Maths & Physics)
binary_c-python
Commits
806f9d18
Commit
806f9d18
authored
4 years ago
by
David Hendriks
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
binarycpython/utils/grid_options_defaults.py
+29
-10
29 additions, 10 deletions
binarycpython/utils/grid_options_defaults.py
binarycpython/utils/stellar_types.py
+3
-1
3 additions, 1 deletion
binarycpython/utils/stellar_types.py
with
32 additions
and
11 deletions
binarycpython/utils/grid_options_defaults.py
+
29
−
10
View file @
806f9d18
"""
"""
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
...
...
This diff is collapsed.
Click to expand it.
binarycpython/utils/stellar_types.py
+
3
−
1
View file @
806f9d18
"""
"""
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
=
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment