This release mainly consists of on-going maintenance / clean-up work to get ready for bigger changes
(bigger changes discussed here: Engine + core/cli re-design · Issue #359 · vocalpy/vak · GitHub – currently me just talking to myself but feel free to chime in)
The main fix here is to logging, so that messages don’t repeat themselves 3 times.
vocalpy:main
← vocalpy:fix-logging-bug-and-refactor
opened 05:46PM - 05 Jul 22 UTC
Fix logging so that log statements do not
repeat themselves (fixes #258).
To d… o this, we needed to remove all the logic
that passed loggers around between functions,
and instead use the stdlib logging module as intended,
as a singleton where child loggers pass messages
up to the root logger. Doing so produces a breaking change:
the `vak.engine.Model.from_config` method
no longer accepts a `logger` parameter.
This also refactors the logging module,
removing `get logger` and replacing it with
`config_log_for_cli`, which lets the cli
configure logging while at the same time
allowing users to configure logging how they want
when they are not using the cli.
--- squash commits ----
- Rewrite vak/logging.py module
+ Remove `log_or_print` function.
Will now just use python Logger methods directly
+ Add `config_logging_for_cli` function.
Allows the `cli` functions to call this to configure
logging the way we run it now, and at the same time
let users configure logging however they want when
they are not using the cli
+ Use timenow.get_timenow_as_str in
`config_logging_for_cli` function for timestamp
- Add 'level' parameter and use to set logging level
- Add a FormatHandler
- Add force parameter, if True then remove handlers
and add new ones
- Rewrite how cli modules configure logging
+ pass force=True into config_logging_for_cli
inside all cli functions
- Make all other modules use stdlib for logging,
by saying `logger = logging.getLogger(__name__)`
outside of any functions, and then using that logger
inside functions
+ This also involved removing `logger` parameters
from functions, and removing any `logger` arguments
in function calls
+ including a *Breaking change*: remove `logger` argument from
`vak.engine.Model.from_config`
- Remove logger parameter from vak.models.from_model_config_map
- Remove logger parameter from TeenyTweetyNet.from_config method
- Remove logger parameter from vak.split.train_test_dur_split_inds
- remove logger arguments from all function calls in tests
Fixing that required making a breaking change to the vak.engine.Model
class, so I went ahead and released a new “minor” version, and made a corresponding fix in TweetyNet
then made a new release for that package too.
More notes here:
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Added
- Add unit tests for `csv.has_unlabled`
[#541](https://github.com/NickleDave/vak/pull/541).
Fixes [#102](https://github.com/NickleDave/vak/issues/102).
- Add unit tests for `__main__`
[#542](https://github.com/NickleDave/vak/pull/542).
Fixes [#337](https://github.com/NickleDave/vak/issues/337).
- Add validation of `labels` argument to `vak.split.algorithms.brute_force`,
to prevent conditions where algorithm can fail to converge
because of bad input
[#562](https://github.com/NickleDave/vak/pull/562).
Fixes [#288](https://github.com/NickleDave/vak/issues/288).
- Add a "Frequently Asked Questions" page to the documentation,
This file has been truncated. show original