Conversation
jnnsbrr
commented
Sep 23, 2025
- add black flake8 compatibility
- add basic unit tests for data_model and model_components
There was a problem hiding this comment.
Pull Request Overview
This PR adds PyPI support to the pycopancore project by implementing black and flake8 code formatting compatibility and adding basic unit tests for core functionality. The changes primarily focus on code formatting improvements and establishing test infrastructure rather than functional modifications.
- Black code formatting applied consistently across the codebase to ensure PEP 8 compliance
- Addition of comprehensive unit tests covering data_model and model_components modules
- Configuration updates to support development tools (black, flake8) and remove deprecated scripts
Reviewed Changes
Copilot reviewed 106 out of 107 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_*.py | New unit test files covering core functionality of data_model and model_components |
| pyproject.toml | Updated dev dependencies and added black/flake8 configuration |
| templates/**.py | Reformatted code with black for consistency |
| pycopancore/**.py | Black formatting applied throughout source code |
| scripts/release.sh, scripts/update_citation.py | Removed deprecated release scripts |
Comments suppressed due to low confidence (1)
pycopancore/model_components/base/implementation/init.py:1
- Star imports should be avoided. Instead, explicitly import the needed classes or use all to control what gets imported.
"""
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| # ADJUST FILENAME HERE: | ||
| filename = "/tmp/without_social.pickle" |
There was a problem hiding this comment.
Hard-coded file path should be configurable or use a more appropriate temporary directory. Consider using tempfile.gettempdir() or making this a parameter.
| # ADJUST FILENAME HERE: | |
| filename = "/tmp/without_social.pickle" | |
| import argparse | |
| import os | |
| import tempfile | |
| parser = argparse.ArgumentParser(description="Plot trajectory from pickle file.") | |
| default_filename = os.path.join(tempfile.gettempdir(), "without_social.pickle") | |
| parser.add_argument( | |
| "--filename", | |
| type=str, | |
| default=default_filename, | |
| help=f"Path to pickle file (default: {default_filename})", | |
| ) | |
| args = parser.parse_args() | |
| filename = args.filename |
| # time! if solout returns 0 (or -1?), solver will | ||
| # terminate. Similarly for solver "vode" above | ||
| print(" t =", sol_t, " ", end='\r') | ||
| print(" t =", sol_t, " ", end="\r") |
There was a problem hiding this comment.
Debug print statements should use proper logging instead of print. Consider using the logging module for better control over output.
| if len(values) == 0: | ||
| print(inst, self) |
There was a problem hiding this comment.
Debug print statement should use proper logging. Also consider raising an exception or handling the empty values case more explicitly.
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |