Skip to content

add cli #33

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 8 commits into from
Aug 21, 2025
Merged

add cli #33

merged 8 commits into from
Aug 21, 2025

Conversation

Tieqiong
Copy link
Contributor

@sbillinge please check, thanks

This add nice cli features to diffpy.cmi, including:

One command to install optional dependencies and run workflows using mamba/conda:

  • Install sets of packages (called "packs") into a conda environment.
    • channels and versions of dependencies can be specified by packs txt files. A dependency line be replaced by a general script (.sh/.bat) for weird installations or local compilations . An example of diffpy.srreal is included.
  • Compose packs into profiles for full “workspace” setups. Automate common workflows with modularity and expandability.
    • can specify extra dependencies beside "packs" and use script to run post-steps. An example of running pytest for all the dependencies to check installation is included.

One command to get information about your cmi:

  • Dynamically check installed and waiting to be installed packs/profiles.
  • Logging system and debug mode for easy diagnostics
  • Nice examples and manual system

It’s designed to be quiet by default, easy to use, and easy to extend.
Works on all platforms (hopefully)

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.

wow, that is amazing! Thanks so much @Tieqiong .

Please could we have a few words in the readme with the new installation instructions so I can test it out? We can write more complete documentation into the docs after we do some testing, so keeping this brief for now.....

This needs a news, for sure, and it is failing CI. Does it need to be merged in order to pass CI or there is a tweak needed to the workflows?

@Tieqiong
Copy link
Contributor Author

@sbillinge our central release-script only knows to install dependencies from requirement/conda.txt and requirement/tests.txt, which doesn't exist here anymore. Need to add this two files back temporarily as workaround.

@Tieqiong
Copy link
Contributor Author

Tieqiong commented Aug 19, 2025

I didn't change how cmi get diffpy.srreal for now because the cross-compile in the feedstock for arm Mac was not setup. Now it's still getting diffpy.srreal from pypi, but this ensure it works for all platforms. Some basic instructions are added to readme.

Now the "core" pack only has diffpy.utils, diffpy.srfit, diffpy.structure (and running dependencies packaging and PyYAML), and the "pdf" pack has diffpy.srreal and pyobjcrst. "tests" pack has all the testing stuff. "plotting" pack has all the plotting stuff. Run cmi install <pack_name> can install an individual pack.

Now cmi has two "profiles": all and _tests. Run cmi install all will install all run requirements (core + pdf + plotting), and cmi install _tests will install all run and tests requirement and test it against all the downstream tests (srreal, srfit, pyobjcryst, structure, utils).

@Tieqiong
Copy link
Contributor Author

diffpy.srreal should be available for all platforms now. Remove script install and use conda

Copy link

codecov bot commented Aug 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.00%. Comparing base (434f7ee) to head (ac2b4c3).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #33       +/-   ##
===========================================
- Coverage   75.67%   50.00%   -25.68%     
===========================================
  Files           3        2        -1     
  Lines          37       18       -19     
===========================================
- Hits           28        9       -19     
  Misses          9        9               
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sbillinge
Copy link
Contributor

I am super excited about this. Before I merge this I will do some testing on the version of diffpy.cmi on CF, just for a day or two, then I will merge this and test again. Then we can write te docs. I would like to write a new paper on this too. We can discuss what and when and who does what. I would like to position this as a more general regression engine rather than a local-structure thing, so I would like to do some examples where we use the modularity and flexibility more.

@Tieqiong
Copy link
Contributor Author

let me update the CI for matrix before we merge it.

Tieqiong and others added 2 commits August 21, 2025 17:08
macos-13 shell script support
Use personal diffpy.utils tests source temporaly
properly pass exit code for install cmd
@Tieqiong
Copy link
Contributor Author

@sbillinge ready for review!

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