Open yucongalicechen opened 3 weeks ago
@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.
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
- visitor wants to greet colleague politely
- visitor holds out flat palm and approaches colleague
- visitor stops 3 feet away and awaits response
- colleague reaches and and grasps visitor hand
- visitor makes firm but not too firm grip
- visitor moves hand up and down four times and then lets go, making eye contact and smiling
- visitor takes a step back and starts converation.
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
- user places sample on diffractometer
- diffractometer determines weight and dimensions of the sample
- diffractometer shares this information with labpdfproc
- labpdfproc computes muD
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