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

Fix imports and add CLI file viewer #44

Merged
merged 3 commits into from
May 26, 2023

Conversation

mrakitin
Copy link
Contributor

This pull request fixes more imports (missed from #42) to be able to use the srwpy.SRWLIB_ExampleViewDataFile.py data file viewer.

Also, this adds a convenient script to avoid a long line to execute it

$ python -m srwpy.SRWLIB_ExampleViewDataFile -f ex10_res_int_prop_me.dat

reduced to

$ srw-viewer -f ex10_res_int_prop_me.dat

I added a step in the CI workflow to test the help for the script:

$ srw-viewer --help

Usage: srw-viewer [options]

Options:
  -h, --help            show this help message and exit
  -f FILE, --infile=FILE
                        input file name
  -e NUMBER, --e=NUMBER
                        photon energy
  -x NUMBER, --x=NUMBER
                        horizontal position
  -y NUMBER, --y=NUMBER
                        vertical position
  -l NUMBER, --readlab=NUMBER
                        read labels from the file header (1) or not (0)
  -j NUMBER, --joined=NUMBER
                        place different graphs jointly into one figure (1) or
                        into separate figures (0)
  -m, --multicol_data   visualize multicolumn data
  --m_colx=STR          column for horizontal axis
  --m_coly=STR          column for vertical axis
  -s SCALE, --scale=SCALE
                        scale to use in plots (linear, log, log2, log10)
  -w WIDTH, --width-pixels=WIDTH
                        desired width of pixels

I updated the version to 4.0.0b1 for the next beta release.

mrakitin added 3 commits May 26, 2023 00:16
Copying is not needed as we do not generate sdist archives, and wheels
deal with the metadata differently, so it's fine to read the file from
two levels above. That will also simplify local installs from the cloned
repo and in the conda-forge feedstock.
@himanshugoel2797
Copy link
Contributor

Looks good to me, but only Oleg has permissions to merge changes.

@ochubar ochubar merged commit 9338785 into ochubar:master May 26, 2023
@mrakitin mrakitin deleted the fix-imports-and-cli-viewer branch May 26, 2023 18:49
@mrakitin
Copy link
Contributor Author

Thank you, @ochubar and @himanshugoel2797!

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.

3 participants