Skip to content

Conversation

@cadenmyers13
Copy link
Contributor

Updated cli commands from conversation recorded here: https://github.com/bg-mission-control/mission-control/issues/5

I've listed the outputs of commands below. I also tested the copy feature with different target dirs and force permutations.

All -h commands

$ cmi -h
usage: cmi [-h] [-v] [-V] [--manual] <command> ...

Welcome to diffpy.cmi, a complex modeling infrastructure for multi-modal
analysis of scientific data.

positional arguments:
  <command>
    info         Show info about packs, profiles, and examples.
    install      Install packs/profiles.
    copy         Copy example directories.
    env          Show basic conda environment info

options:
  -h, --help     show this help message and exit
  -v, --verbose  Enable debug logging. (default: False)
  -V, --version  show program's version number and exit
  --manual       Open manual and exit. (default: False)
$ cmi info -h
usage: cmi info [-h] <command> ...

positional arguments:
  <command>
    packs     Show available and installed packs.
    profiles  Show available and installed profiles.
    examples  Show available examples to copy.

options:
  -h, --help  show this help message and exit
$ cmi install -h
usage: cmi install [-h] [-c DEFAULT_CHANNEL] [targets ...]

positional arguments:
  targets               One or more targets: pack/profile base names or
                        absolute profile file/dir.

options:
  -h, --help            show this help message and exit
  -c, --channel DEFAULT_CHANNEL
                        Default conda channel for packages without explicit
                        per-line channel.
$ cmi copy -h
usage: cmi copy [-h] [-t DIR] [-f] <commands>...

Copy example directories to the current or specified location.

positional arguments:
  name                  Example name(s) to copy. Use `cmi info examples` to
                        list.

options:
  -h, --help            show this help message and exit
  -t, --target-dir DIR  Target directory to copy examples into. Defaults to
                        current working directory.
  -f, --force           Force overwrite existing files and merge directories.

non -h commands

$ cmi env
Conda environment:
  available : True
  mamba     : False
  env_name  : cmi-testing
  prefix    : /opt/miniconda3/envs/cmi-testing
$ cmi info
Installed Packs:
----------------
  core
  docs
  pdf
  plotting
  tests

Available Packs:
----------------
  (all packs installed)

Installed Profiles:
-------------------
  all

Available Profiles:
-------------------
  _tests

Examples:
---------
  core:
   - linefit
  pdf:
   - ch03NiModelling
   - ch05Fit2Phase
   - ch06RefineCrystalStructureGen
   - ch07StructuralPhaseTransitions
   - ch08NPRefinement
   - ch11ClusterXYZ

INFO: Run `cmi info -h` for more options.
$ cmi info packs
Installed Packs:
----------------
  core
  docs
  pdf
  plotting
  tests

Available Packs:
----------------
  (all packs installed)
$ cmi info profiles
Installed Profiles:
-------------------
  all

Available Profiles:
-------------------
  _tests
$ cmi info examples
Examples:
---------
  core:
   - linefit
  pdf:
   - ch03NiModelling
   - ch05Fit2Phase
   - ch06RefineCrystalStructureGen
   - ch07StructuralPhaseTransitions
   - ch08NPRefinement
   - ch11ClusterXYZ

copytree(src, dest)
return dest


Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced all above copying code with code from PacksManager. Bascially all the work over the last few weeks replaces the above.

)
if not localpath.is_file():
plog.info("Manual files not found, falling back to online version.")
url = "https://www.diffpy.org/products/diffpycmi"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified so it just takes you to diffpy.org page

@cadenmyers13
Copy link
Contributor Author

@sbillinge ready for review. Left some inline comments to hopefully make reviewing easier

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.70%. Comparing base (6c1ca2c) to head (b5d12d3).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #76      +/-   ##
==========================================
+ Coverage   92.47%   92.70%   +0.23%     
==========================================
  Files           3        3              
  Lines         186      192       +6     
==========================================
+ Hits          172      178       +6     
  Misses         14       14              
Files with missing lines Coverage Δ
tests/conftest.py 89.88% <100.00%> (+0.99%) ⬆️
tests/test_packsmanager.py 94.94% <100.00%> (-0.11%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

this looks good. I think the help statements need a few more words describing what packs and profiles are. As it stands the help is helpful if you know this, but not so helpful if you don't. Giving users hints about how to proceed is also helpful in a help. We can do this by using a similar structure to our warnings "what went wrong. What to do next to try and fix it" . Help is like that but for usage.

Please could you go through all the info -h's that you copy-pasted in the convo (thanks for that....super helpful....also thanks for the inline comments explaining things....also super helpful....more like this!) and try and look at them from the point of view of someone who doesn't actually know what the words mean?

But the structure is now super good. Ready to merge when we get these cosmetics right (and also figure out what is wrong in the test tmdir)

@cadenmyers13
Copy link
Contributor Author

cadenmyers13 commented Nov 6, 2025

@sbillinge ready for review. Here's what the two new help messages look like

$ cmi -h
usage: cmi [-h] [-v] [-V] [--manual] <command> ...

Welcome to diffpy.cmi, a complex modeling infrastructure for
multi-modal analysis of scientific data.

Diffpy.cmi is designed as an extensible complex modeling
infrastructure. Users and developers can readily integrate
novel data types and constraints into custom workflows. While
widely used for advanced analysis of structural data, the
framework is general and can be applied to any problem where
model parameters are refined to fit calculated quantities to
data.

Diffpy.cmi is comprised of modular units called 'packs' and
'profiles' that facilitate tailored installations for specific
scientific applications. Run 'cmi info -h' for more details.

positional arguments:
  <command>
    info         Prints info about packs, profiles, and examples.
    install      Install packs/profiles.
    copy         Copy example directories.
    env          Show basic conda environment info

options:
  -h, --help     show this help message and exit
  -v, --verbose  Enable debug logging.
  -V, --version  show program's version number and exit
  --manual       Open online documentation and exit.
$ cmi info -h
usage: cmi info [-h] <command> ...

Definitions:
pack:    A collection of data processing routines, models, and examples.
          For example, the 'pdf' pack contains packages used for modeling
          and refinement of the Atomic Pair Distribution Function (PDF).

profile: A set of pre-defined packs or configurations for a specific
          scientific workflow. Profiles can be installed or customized
          for different use cases.

examples: Example scripts or folders that can be copied locally using
          'cmi copy <example_name>'.
  

positional arguments:
<command>
  packs     Show available and installed packs.
  profiles  Show available and installed profiles.
  examples  Show available examples to copy.

options:
-h, --help  show this help message and exit

@sbillinge sbillinge merged commit 224741d into diffpy:main Nov 6, 2025
7 checks passed
@sbillinge
Copy link
Contributor

Those help messages were great.

On a future PR, please just make sure that punctuation and capitalization is consistent across them. I only saw one issue (missing period if our style is to place periods) but I didn't systematically scan for that.

Please ask chatgpt is the open source standard is to punctuate/capitalize these or not and let's follow the standard (and standardize across the group software moving forward)

@cadenmyers13 cadenmyers13 deleted the cli-cmds branch November 7, 2025 17:20
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