Skip to content

feat: options for estimating muD theoretically #173

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

Merged
merged 4 commits into from
Apr 28, 2025

Conversation

yucongalicechen
Copy link
Collaborator

closes #143
@sbillinge ready for review

Here's a gui snapshot:
gui

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.

please see comments

2. Estimate muD from a z-scan file (`-z` or `--z-scan-file`).
2. Estimate from a z-scan file (`-z` or `--z-scan-file`).
3. Estimate theoretically based on sample mass density
(`-td` or `--theoretical-from-density`).
Copy link
Contributor

Choose a reason for hiding this comment

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

check but this is breaking the usual pattern that it should be -l (one letter) or --letters (multiple letters need multiple dashes.

"and sample mass density (in g/cm^3), in that exact order, "
"separated by commas (e.g., ZrO2,20,1.5). "
"If you add whitespaces, "
"enclose it in quotes (e.g., 'ZrO2, 20, 1.5'). "
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

allow whitespace - edits in help message

Copy link
Contributor

Choose a reason for hiding this comment

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

What does the parser do if there is whitespace but no quotes. Did you test that?

@yucongalicechen
Copy link
Collaborator Author

@sbillinge ready for another review! I addressed the comment about the whitespace and edited help messages accordingly.

Copy link

codecov bot commented Apr 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.31%. Comparing base (9618ab0) to head (f224f3c).
Report is 13 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #173   +/-   ##
=======================================
  Coverage   99.31%   99.31%           
=======================================
  Files           5        5           
  Lines         292      292           
=======================================
  Hits          290      290           
  Misses          2        2           
Files with missing lines Coverage Δ
tests/test_tools.py 98.84% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

please see comments

@@ -21,12 +21,13 @@ def _define_arguments():
"The filename(s) or folder(s) of the datafile(s) to load. "
"Required.\n"
"Supply a space-separated list of files or directories. "
"If a filename contains whitespace, enclose it in quotes. "
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe mention that, as a general matter, avoid filenames with whietspaces in, but if it does, then enclose in quotes

"and sample mass density (in g/cm^3), in that exact order, "
"separated by commas (e.g., ZrO2,20,1.5). "
"If you add whitespaces, "
"enclose it in quotes (e.g., 'ZrO2, 20, 1.5'). "
Copy link
Contributor

Choose a reason for hiding this comment

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

What does the parser do if there is whitespace but no quotes. Did you test that?

"in that exact order "
"and separated by commas with no whitespaces "
"(e.g., 'ZrO2,2,0.5')."
"Specify the chemical formula, incident x-ray energy (in keV), "
Copy link
Contributor

Choose a reason for hiding this comment

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

since this seems to be used 2x, define it in a variable and call the variable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@sbillinge ready for another review. I edited the help messages according to the comments above. When there's whitespace but no quotes the CLI will raise an error saying that it doesn't recognize the command

"separated by commas (e.g., ZrO2,17.45,0.5). "
"If you add whitespaces, "
"enclose it in quotes (e.g., 'ZrO2, 17.45, 0.5'). "
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

common part for help messages

@@ -21,12 +28,14 @@ def _define_arguments():
"The filename(s) or folder(s) of the datafile(s) to load. "
"Required.\n"
"Supply a space-separated list of files or directories. "
"Avoid spaces in filenames when possible; "
"if present, enclose the name in quotes. "
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

edit input help message

@sbillinge sbillinge merged commit 59198ce into diffpy:main Apr 28, 2025
5 checks passed
@yucongalicechen yucongalicechen deleted the muD-theoretical branch May 1, 2025 15:42
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.

Implement multiple options for computing muD
2 participants