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

New CLI Options #364

Merged
merged 31 commits into from
Mar 7, 2024
Merged

New CLI Options #364

merged 31 commits into from
Mar 7, 2024

Conversation

tasansal
Copy link
Collaborator

@tasansal tasansal commented Mar 7, 2024

Continues #230

Had to refactor due to recent CLI changes in main. Also added the following to @markspec's work:

  1. Rich printing support
  2. Refactored info command to components
  3. Refactored arguments and options for all CLI
  4. Lazy imports and added fastentrypoints [CLI much faster now]
  5. Made required parameters arguments instead of options (I/o files etc) [BREAKING]
  6. Changed overwrite to flag [BREAKING]
  7. Update tests accordingly
  8. Update docs accordingly

markspec and others added 27 commits March 7, 2024 10:00
ments.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# interactive rebase in progress; onto 2fa8069
# Last commands done (3 commands done):
#    pick 7db1c77 Updates to pass pre-commit.
#    pick 9197e4e Bug fix and log statements.
# Next commands to do (2 remaining commands):
#    pick f382208 Updatest to resolve conflicts with changes related to floating point headers for indexing.
#    pick 6961e1d Fix pre-commit linting.
# You are currently rebasing branch 'main' on '2fa8069'.
#
# Changes to be committed:
#	modified:   src/mdio/segy/utilities.py
#	modified:   tests/integration/test_segy_import_export.py
#
# Untracked files:
#	.devcontainer_bck/Dockerfile
#	.devcontainer_bck/devcontainer.json
#	.devcontainer_bck/post-install.sh
#	.gitignore_bck
#	TEST.md
#	debugging/0__6372_PREPNODMLT.LIBRARY_2.mdio.jpg
#	debugging/6372_export.py
#	debugging/6372_ram_usage.csv
#	debugging/6372_ram_usage.csv_bck
#	debugging/Debug.md
#	debugging/None
#	debugging/docker_env/bin/Activate.ps1
#	debugging/docker_env/bin/activate
#	debugging/docker_env/bin/activate.csh
#	debugging/docker_env/bin/activate.fish
#	debugging/docker_env/bin/dask
#	debugging/docker_env/bin/dask-scheduler
#	debugging/docker_env/bin/dask-ssh
#	debugging/docker_env/bin/dask-worker
#	debugging/docker_env/bin/doesitcache
#	debugging/docker_env/bin/dul-receive-pack
#	debugging/docker_env/bin/dul-upload-pack
#	debugging/docker_env/bin/dulwich
#	debugging/docker_env/bin/easy_install
#	debugging/docker_env/bin/easy_install-3.8
#	debugging/docker_env/bin/f2py
#	debugging/docker_env/bin/f2py3
#	debugging/docker_env/bin/f2py3.8
#	debugging/docker_env/bin/fonttools
#	debugging/docker_env/bin/jsonschema
#	debugging/docker_env/bin/keyring
#	debugging/docker_env/bin/pip
#	debugging/docker_env/bin/pip3
#	debugging/docker_env/bin/pip3.8
#	debugging/docker_env/bin/pkginfo
#	debugging/docker_env/bin/poetry
#	debugging/docker_env/bin/py-spy
#	debugging/docker_env/bin/pyftmerge
#	debugging/docker_env/bin/pyftsubset
#	debugging/docker_env/bin/pyproject-build
#	debugging/docker_env/bin/python
#	debugging/docker_env/bin/python3
#	debugging/docker_env/bin/ttx
#	debugging/docker_env/bin/virtualenv
#	debugging/docker_env/lib64
#	debugging/docker_env/share/man/man1/ttx.1
#	debugging/docker_env/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/appdirs-1.4.3-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/certifi-2019.11.28-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/chardet-3.0.4-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/colorama-0.4.3-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/contextlib2-0.6.0-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/distlib-0.3.0-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/distro-1.4.0-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/html5lib-1.0.1-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/idna-2.8-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/ipaddr-2.2.0-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/lockfile-0.12.2-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/msgpack-0.6.2-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/packaging-20.3-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/pep517-0.8.2-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/pip-20.0.2-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/progress-1.5-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/pyparsing-2.4.6-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/requests-2.22.0-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/retrying-1.3.3-py2.py3-none-any.whl
#	debugging/docker_env/share/python-wheels/setuptools-44.0.0-py2.py3-none-any.whl
#	deb
Updated the segy.py file to import specific functions from click, rather than the entire module. The command decorator's function signatures and calls are also updated. This is to improve specificity and reduce unnecessary overhead. Additionally, modified the way command line arguments are passed in test_main.py as per the refactored changes in the main function.
The import statement for 'MDIOReader' in the copy.py file has been moved to a more appropriate position. This change aims to maximize importing efficiency by having the import statement closer to where the imported module is being used.
The MDIO info command is refactored to enhance code readability and maintenance. The new structure involves separate functions for 'cast_stats', 'parse_grid' and 'pretty_print' to each perform distinct tasks. This improves the clear segregation of tasks and ease of future modifications.
The documentation for the mdio commands has been updated to reflect changes in the command syntax. Parameters for input and output files are now required positional arguments, rather than options, enhancing the clarity and readability of the commands.
@tasansal tasansal added the enhancement New feature or request label Mar 7, 2024
@tasansal tasansal requested a review from markspec March 7, 2024 18:42
@tasansal tasansal self-assigned this Mar 7, 2024
@tasansal tasansal merged commit 28a8e9f into main Mar 7, 2024
20 checks passed
@tasansal tasansal deleted the new-cli-options-and-refactor branch March 7, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants