-
Notifications
You must be signed in to change notification settings - Fork 21
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 docs for check_and_build_global_config()
#270
base: main
Are you sure you want to change the base?
Conversation
@@ -95,12 +96,32 @@ it will only run once. However, if you want to bypass this behavior, | |||
``check_and_build_global_config()`` takes an optional boolean ``skip_config_creation`` parameter that | |||
could be set to ``True`` at runtime to override the config creation. | |||
|
|||
What happens when you run ``check_and_build_global_config()``? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add example
@@ -111,7 +132,7 @@ Locate the file ``diffpyconfig.json``, in your home directory and open it in an | |||
"owner_orcid": "0000-0000-4321-1234" | |||
} | |||
|
|||
Then you can edit the username and email as needed, make sure to save your edits. | |||
Then you can edit the username and email as needed, make sure to save your edits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reformat
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #270 +/- ##
=======================================
Coverage 98.68% 98.68%
=======================================
Files 8 8
Lines 379 379
=======================================
Hits 374 374
Misses 5 5 |
|
||
|
||
def stringify(obj): | ||
def _stringify(obj): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this function private and remove unncessary functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beautifully done. Just a couple of suggestions in line
After receiving the inputs, the function will write the following to the file: | ||
|
||
.. code-block:: python | ||
{"owner_name": "Jane Doe", "owner_email": "[email protected]", "owner_orcid": "0000-0000-0000-0000"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blank line needed here?
Please enter your orcid ID if you know it: 0000-0000-0000-0000 | ||
|
||
|
||
After receiving the inputs, the function will write the following to the file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe ".... the diffpyconfig.json file in the users home directory"?
On the one hand it is a bit repetitive (also did elsewhere), but maybe it is better to be clear?
Developers can use this function to simplify the process of loading, merging, and saving information consistently and easily. | ||
Additionally, it saves the effort of re-entering information, and allows overriding current information by | ||
passing parameters. | ||
|
||
- ``check_and_build_global_config()``: This function helps create a global configuration file | ||
that can be used by ``get_user_info()``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe say, "...used by, for example, get_user_info()
..."
It could also be used by some other user written function
Developers can use this function to simplify the process of loading, merging, and saving information consistently and easily. | ||
Additionally, it saves the effort of re-entering information, and allows overriding current information by | ||
passing parameters. | ||
|
||
- ``check_and_build_global_config()``: This function helps create a global configuration file | ||
that can be used by ``get_user_info()``. | ||
If no existing configuration file is found, and the user allows inputs, this function prompts for information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "user allows inputs" is confusing so I recommend to delete that.
.. code-block:: python | ||
{"owner_name": "Jane Doe", "owner_email": "[email protected]", "owner_orcid": "0000-0000-0000-0000"} | ||
After receiving the inputs, the function will write the information to | ||
the `diffpyconfig.json` file in your home directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deleted the example here - there are examples both before and after this section
that can be used by ``get_user_info()``. | ||
If no existing configuration file is found, and the user allows inputs, this function prompts for information. | ||
that can be used by, for example, ``get_user_info()``. | ||
If no existing configuration file is found, this function prompts for information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleted "allows inputs"
@sbillinge ready for review! |
closes #268
@sbillinge ready for review