-
Notifications
You must be signed in to change notification settings - Fork 21
Added extra information in warning for better capturing of user info #149
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
Changes from 4 commits
7112fac
d24acb6
0a59a0b
2379a62
4bb5ecf
2732b49
e36726e
c367349
5bfc9dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
**Added:** | ||
|
||
* Better wording on the capture user info functionality | ||
|
||
**Changed:** | ||
|
||
* <news item> | ||
|
||
**Deprecated:** | ||
|
||
* <news item> | ||
|
||
**Removed:** | ||
|
||
* <news item> | ||
|
||
**Fixed:** | ||
|
||
* <news item> | ||
|
||
**Security:** | ||
|
||
* <news item> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
**Added:** | ||
|
||
* Warning message for missing global config file | ||
|
||
**Changed:** | ||
|
||
* <news item> | ||
|
||
**Deprecated:** | ||
|
||
* <news item> | ||
|
||
**Removed:** | ||
|
||
* <news item> | ||
|
||
**Fixed:** | ||
|
||
* <news item> | ||
|
||
**Security:** | ||
|
||
* <news item> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import importlib.metadata | ||
import json | ||
import os | ||
import warnings | ||
from copy import copy | ||
from pathlib import Path | ||
|
||
|
@@ -114,6 +115,11 @@ def get_user_info(args=None): | |
global_config = load_config(Path().home() / "diffpyconfig.json") | ||
local_config = load_config(Path().cwd() / "diffpyconfig.json") | ||
if global_config is None and local_config is None: | ||
warnings.warn( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not quite what I had in mind. Just the warning messages in the prompts could be clearer. We could put this preamble message here if we really like it, but I would like to see it in the context of the full workflow pasted in the comments before deciding. @alisnwu have you run through the whole workflow to see what it looks like and where it can be improved? Even if we do want this wording, I think this is not a good use of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sbillinge Would this be a better way to word the prompts? ![]() There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, I like that (modulo a slight grammatical boo boo)! How about something a bit more human friendly: we need a workflow for people to update this global config file later if they want. Pease could you make an issue to check/work on that and maybe do it on a separate PR? Thanks! |
||
"No global config file, please follow prompts below. " | ||
"The global config file is very important in crediting your work in the future. " | ||
"For more information, please refer to www.diffpy.org/diffpy.utils/examples/toolsexample.html" | ||
) | ||
config_bool = _create_global_config(args) | ||
global_config = load_config(Path().home() / "diffpyconfig.json") | ||
config = _sorted_merge(clean_dict(global_config), clean_dict(local_config), clean_dict(args)) | ||
|
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.
we can delete this file.