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

add docs for check_and_build_global_config() #270

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

Conversation

yucongalicechen
Copy link
Contributor

closes #268
@sbillinge ready for review

@@ -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()``?
Copy link
Contributor Author

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.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reformat

Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.68%. Comparing base (d791c63) to head (13742d0).
Report is 4 commits behind head on main.

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):
Copy link
Contributor Author

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

Copy link
Contributor

@sbillinge sbillinge left a 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"}
Copy link
Contributor

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:
Copy link
Contributor

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()``.
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor Author

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.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleted "allows inputs"

@yucongalicechen
Copy link
Contributor Author

@sbillinge ready for review!

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.

fix typo, remove unncessary functions, and add example for update_config_workflow
2 participants