-
Notifications
You must be signed in to change notification settings - Fork 10
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 xraydb function to compute muD #126
base: main
Are you sure you want to change the base?
Conversation
…/density/diameter so that we can compute muD for user
args.diameter = args.diameter or float(input("Please enter the capillary diameter (mm): ").strip()) | ||
args.mud = args.mu * args.diameter | ||
return args | ||
args.sample = args.sample or input("Please enter the chemical formula or name of material: ").strip() |
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 added some input prompts because it might be easier to enter from here than from cli inputs.
@@ -281,7 +326,8 @@ def preprocessing_args(args): | |||
args.output_directory = set_output_directory(args) | |||
args = set_wavelength(args) | |||
args = set_xtype(args) | |||
args = set_mud(args) | |||
args = set_mud_from_zscan_file(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.
Here I am thinking that during the pre-processing we first check for z-scan files and read muD from there. If there's no file /muD provided, we then proceed to ask for other information.
@till-schertenleib I could use some advice on this implementation, if you find other user-friendly muD functions or have any suggestions for improving the instructions! |
When we add user functionality like this it is important to get it right, which includes users. Let's discuss first what use-case we want to code up before coding anything or we risk making the code worse. @yucongalicechen do you remember how to do a Use case? It is a list of actions that begins with an actor, something like
Use your judgement, but talk to people who might use the code. Don't start from the code. e.g., don't say things like "user enters density" because you are then writing the UC to the code, not the code to the UC. For example, a good UC would be
would be a great UC! It may be too difficult for us to engineer right now, so we save it for later and write another UC. In the end we impement the one that is the best balance between what is desirable and what is possible. |
Yes, I remember the UC. Thanks for the suggestions, I will talk to people and work on the UCs first! |
closes #9
I have added optional arguments (mu, d, sample, energy, density) that can be used with the xraydb function to compute muD. I didn't put any error messages for invalid inputs, because I think both the input function and xraydb give clear enough error messages (e.g. for invalid float number or incorrect sample names), but I can add some if needed.
@sbillinge ready for review