Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds dual-engine support to PyBeePop, enabling the package to run simulations using either a C++ engine or a pure Python engine. The key changes include:
- Introduction of engine selection mechanism with
engineparameter supporting "auto", "cpp", and "python" modes - Implementation of a complete Python port of the BeePop+ C++ simulation engine
- Addition of macOS support through the Python engine (C++ not available on macOS)
- Extensive new test coverage for dual-engine functionality and exception parity
Reviewed Changes
Copilot reviewed 35 out of 36 changed files in this pull request and generated 51 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_pybeepop.py | Parameterized existing tests to run with both engine types; added duplicate import statements |
| tests/test_dual_engine.py | New comprehensive test suite for dual-engine functionality and exception parity |
| tests/test_adapters.py | New test suite for engine adapter interface compliance |
| pyproject.toml | Version bump to 0.2.0; added macOS support and dylib files |
| pybeepop_example.ipynb | Updated with engine selection documentation and examples |
| pybeepop/pybeepop.py | Major refactor to support dual-engine architecture with adapter pattern |
| pybeepop/exceptions.py | New custom exception classes with enhanced error reporting |
| pybeepop/engine_interface.py | Protocol definition for engine interface compatibility |
| pybeepop/beepop/* | Complete Python port of C++ BeePop+ simulation engine modules |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/test_pybeepop.py
Outdated
| import pybeepop.tools as tools | ||
| import pybeepop.tools as tools |
There was a problem hiding this comment.
Duplicate import of pybeepop.tools as tools on consecutive lines. Remove one of the duplicate imports.
tests/test_pybeepop.py
Outdated
| import pybeepop.tools as tools | ||
| import pybeepop.tools as tools |
There was a problem hiding this comment.
Duplicate import of pybeepop.tools as tools on consecutive lines. Remove one of the duplicate imports.
tests/test_pybeepop.py
Outdated
| import pybeepop.tools as tools | ||
| import pybeepop.tools as tools |
There was a problem hiding this comment.
Duplicate import of pybeepop.tools as tools on consecutive lines. Remove one of the duplicate imports.
pybeepop/beepop/daterangevalues.py
Outdated
| destination.enabled = self.enabled | ||
| destination.file_format_version = self.file_format_version |
There was a problem hiding this comment.
Duplicate assignment of destination.enabled and destination.file_format_version on lines 131-132 and 133-134. Remove the duplicate lines 133-134.
| destination.enabled = self.enabled | |
| destination.file_format_version = self.file_format_version |
| # def set_miticide_treatment(self, start_day_num, duration, mortality, enable): | ||
| # pass | ||
|
|
||
| # def set_miticide_treatment_from_treatments(self, treatments, enable): | ||
| # pass | ||
|
|
There was a problem hiding this comment.
This comment appears to contain commented-out code.
| # def set_miticide_treatment(self, start_day_num, duration, mortality, enable): | |
| # pass | |
| # def set_miticide_treatment_from_treatments(self, treatments, enable): | |
| # pass |
| Returns: | ||
| str: Info log as newline-separated string. | ||
| """ | ||
| ... |
There was a problem hiding this comment.
This statement has no effect.
| Returns: | ||
| str: Version string (e.g., "1.15.25"). | ||
| """ | ||
| ... |
There was a problem hiding this comment.
This statement has no effect.
|
|
||
| This method should be idempotent and safe to call multiple times. | ||
| """ | ||
| ... |
There was a problem hiding this comment.
This statement has no effect.
pybeepop/beepop/beepop.py
Outdated
| return True | ||
| except Exception as e: | ||
| raise e | ||
| return False |
There was a problem hiding this comment.
This statement is unreachable.
| return False |
This pull request introduces a pure Python implementation of BeePop+. Users can select whether to use the original c++ engine or the newer Python engine for BeePop+. Additional improvements include macOS support (python engine only), updated documentation, and code organization for the
pybeepop+project. TheREADME.mdwas also edited for clarity and completeness.*** Pure Python version of BeePop+**
beepop/directory. Documentation is included as docstrings which are parsed into the documentation website.beepop = PyBeePop(engine="python").Platform and CI Support
macos-13,macos-14) to the CI build matrix in.github/workflows/ci-build-publish.yml, ensuring that wheels are built and tested for macOS in addition to Windows and Ubuntu. Conditional steps ensure that macOS builds use only the Python engine, as C++ is not supported. [1] [2].github/workflows/run-tests.yml(renamed fromrun-tests-ubuntu.yml), and removed the redundant Windows-only test workflow. This streamlines CI and guarantees cross-platform test coverage. [1] [2]Documentation Overhaul
README.mdto provide clear installation instructions, engine selection guidance, platform-specific notes, and a detailed quick start guide. The new documentation includes explicit instructions for using both the C++ and Python engines, and clarifies macOS limitations,.