Improved argument parsing and error handling in __main__.py#1
Open
Unnati-2061 wants to merge 1 commit intomasterfrom
Open
Improved argument parsing and error handling in __main__.py#1Unnati-2061 wants to merge 1 commit intomasterfrom
Unnati-2061 wants to merge 1 commit intomasterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
These changes make the script more reliable and user-friendly for both developers and users