Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This minor release brings titillating support for **configuring wrapper logging** and **runtime type-checking wrapper parameters.** This minor release resolves **3 issues.** Noteworthy changes include: ## Features Added * **Wrapper logging configurability.** The high-level `betse.science.wrapper.BetseWrapper` class now enables logging to be configured at instantiation time. Specifically, the `BetseWrapper.__init__` method now accepts these optional logging-specific parameters: * `log_filename`, the relative or absolute filename of a file to append logging messages to. When running BETSE on a cluster, users are advised to set this parameter for each process-specific `BetseWrapper` instance to a filename isolated to that process. Doing so avoids non-deterministic failures when rotating log files, including a dreaded non-human-readable `"OSError: [Errno 116] Stale file handle"` exception emitted when attempting to log to a log file currently being rotated by a competing BETSE process. * `log_level`, a string-based enumeration configuring the global logging level (e.g., `"ALL"`, `"DEBUG"`, `"NONE"`). If specified, this global logging level overrides the optional `verbose` parameter accepted by various public methods of the `BetseWrapper` class. * **Wrapper parameter runtime type-checking.** All parameters passed to all `BetseWrapper` methods are now type-checked at runtime via [`beartype`](https://github.com/beartype/beartype), a performance-friendly third-party pure-Python package. ## Dependencies Added * **Beartype ≥ 0.10.0.** BETSE now requires a reasonably recent version of [`beartype`](https://github.com/beartype/beartype) as a mandatory runtime dependency. ## Issues Resolved * **Fast solver `Dm_cells` export.** BETSE's fast solver now properly exports `Dm_cells` as a function of time. ## Deprecations Resolved * `license_file` -> `license_files` in `setup.cfg`. This release resolves a mostly negligible `setuptools` deprecation warning concerning the deprecated `license_file` setting in the top-level `setup.cfg` file: /usr/lib/python3.8/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead. * `numpy.distutil.__config__` -> `numpy.__config__`. This release resolves a deprecation warning emitted under NumPy ≥ 1.23.0 when importing *anything* from the `numpy.distutil` submodule. Specifically, this commit generalizes the `betse.lib.numpy.numpys` submodule to preferably import the actively maintained `numpy.__config__` submodule under NumPy ≥ 1.23.0 *before* falling back to importing the deprecated `numpy.distutil.__config__` submodule under NumPy < 1.23.0. Doing so improves the likelihood that BETSE will behave as expected under NumPy ≥ 1.24.0, where the deprecated `numpy.distutil` submodule is expected to be removed entirely. ## Tests Improved * **Wrapper testing.** The high-level `betse.science.wrapper.BetseWrapper` class against a barrage of integration tests, including: * `test_wrapper_default()`, exercising that class with default parameters running an initialization phase. * `test_wrapper_logging()`, exercising that class with various non-default logging parameters running an initialization phase. * **Test suite restructured.** Our test suite has been restructured so as to ensure that lower-level unit tests are exercised *before* higher-level integration tests -- improving the readability of test failures when the former fail. (*Planiform plant form!*)
- Loading branch information