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

Improved argument parsing and error handling in __main__.py #140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SophiaLi20
Copy link

This pull request improves the command-line interface for the main.py script in the AtomDB project. The following changes have been made:

Improved Argument Parsing:

Replaced args.compile and args.query with the correct argument names args.compile_species and args.query.
Ensured better clarity in help messages for arguments and commands.
Error Handling:

Added input validation for positive integers for charge and mult arguments.
Ensured exc is non-negative, providing meaningful error messages when invalid values are passed.
Code Modularity and Clarity:

Encapsulated the main logic within a main() function for better structure.
Added comments and docstrings for better readability and maintainability.
User Feedback:

Added informative messages to guide the user during compile_species and query operations.
Benefits:

  • Enhances user experience with clearer error messages and help descriptions.
  • Improves code maintainability and readability for future contributors.
  • Ensures robust input validation to prevent runtime errors.

These changes make the script more reliable and user-friendly for both developers and users

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.

1 participant