Add tests and coverage report, update modules - #18
Merged
Conversation
Add a comprehensive test suite and coverage output (coverage.json); update pytest.ini and include many new test files under tests/. Update docs components (docs/app/components/ThemeToggle.tsx and docs/app/page.tsx). Modify multiple metbit modules and include regenerated __pycache__ (.pyc) artifacts. Update .gitignore to ignore metbit/__pycache__.
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 introduces several improvements and bug fixes across the codebase, focusing on enhanced logging, improved error handling, and minor API and UI adjustments. The most significant change is the refactoring of
metbit/nmr_preprocess.pyto replace print-based debugging with structured logging, making the codebase cleaner and more maintainable. Additional changes improve error handling and user feedback, and update UI components for better accessibility and consistency.Logging and Debugging Improvements:
loggingmodule for debug, info, and error messages inmetbit/nmr_preprocess.py, providing more structured and configurable logging throughout the NMR preprocessing pipeline. [1] [2] [3] [4] [5] [6] [7] [8]Error Handling and API Robustness:
metbit/peak_processe.pyby raising aValueErrorinstead of printing and raising, ensuring proper exception handling.metbit/plotting.pyto requirefile_namewhensave_plot=True, raising aValueErrorif not provided. Also fixed the type annotation for thefile_nameparameter insplot. [1] [2] [3] [4]metbit/pretreatment.pyto raise aValueErrorfor unknown scaler types, improving input validation.metbit/pls.pyto handlen_comp=Noneby setting it to the minimum of sample and feature count, and corrected component indexing inpredict. [1] [2]UI and Accessibility Enhancements:
ThemeTogglecomponent indocs/app/components/ThemeToggle.tsxto explicitly settype="button"on all buttons, improving accessibility and preventing unintended form submissions. [1] [2] [3]Linkcomponents indocs/app/page.tsxfor navigation, ensuring proper client-side routing and accessibility.Minor Refactors and Cleanups:
return print(...)statements in several methods, replacing them with justprint(...)for clarity and correctness inmetbit/genpage.py,metbit/lazy_opls_da.py, andmetbit/metbit.py. [1] [2] [3] [4] [5]These changes collectively improve the maintainability, reliability, and usability of the codebase.Add a comprehensive test suite and coverage output (coverage.json); update pytest.ini and include many new test files under tests/. Update docs components (docs/app/components/ThemeToggle.tsx and docs/app/page.tsx). Modify multiple metbit modules and include regenerated pycache (.pyc) artifacts. Update .gitignore to ignore metbit/pycache.