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

first iteration of functional app #1

Merged
merged 3 commits into from
Feb 26, 2024
Merged

first iteration of functional app #1

merged 3 commits into from
Feb 26, 2024

Conversation

till-schertenleib
Copy link
Collaborator

infrastructure for the app to take input .xy and give output back.

Functions are not correct yet, please review the infrastructure.

Ready for review and merge.

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.

great! few thoughts:

  1. put functions into separate modules and import them into the app. It is a good idea to divide them into a few modules, e.g., one for io, one for functions, etc.
  2. we may want to put the app into a directory called scripts to separate it from the library code. To be consistent, look in some other diffpy projects so we use the same directory structure for this. We will have to update the setup.py and you may have to reinstall package with pip install -e . again for everything to link up (not sure about that)
  3. use load_data() from diffpy.utils. it does all that and has tests. It can also parse the headers in chi files etc.....
  4. we will use argparse.ArgumentParser to parse the inputs. Create a function that you can leave in main call create_parser for that and have it pass back the args (the last line will be args = parser.parse_args() then return args. Then inside main you can access them using args.<argument_name>
  5. set up your IDE to automatically ensure the file ends with a blank line.

We may want to think of some use-cases (things that chemists will want to do) and make sure the app supports as many of them as possible. This is an activity with a pen and paper. For this PR we can just do this one:
UC1:

  1. chemist has a file with a powder pattern in it and wants to apply an absorption correction
  2. chemist runs labpdfproc app giving it the file and the sample mu and the sample diameter
  3. program outputs a new chi file that is absorption corrected

There will be other UCs and we can decide which we want. e.g.,
UC2:

  1. as UC1.1 - 1.2 but user also gives lambda information
  2. as UC1.3 but app also outputs a chi file on a Q-grid.

Something like that. We should collect all the UCs we can think of and store them somewhere, probably in the issues somewhere.

@sbillinge sbillinge merged commit 9f3d524 into diffpy:main Feb 26, 2024
@sbillinge sbillinge deleted the package branch February 26, 2024 22:45
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.

2 participants