chore: adding more tests to ActivationsStore + light refactoring #20
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 PR contains a few new tests for ActivationsStore (pretty modest though), and some light refactoring of the test setup code and ActivationsStore. Specifically, this PR changes the following:
tests/helpers.py
where generic test utils can be putLanguageModelSAERunnerConfig
tobuild_sae_config
helper intests/helpers.py
. This helper defines a default config, but allows any overrides to be passed in as kwargs. This is trying to be a lightweight version of the test factory pattern, like in https://github.com/FactoryBoy/factory_boy. This lets tests just override only the keys that are important for the test, and makes it more clear what part of the config is relevant for the test.ActivationsStore
where sometimes the BOS token is added twice at the start of a batchActivationsStore
, and breaks out some of the token selecting logic into a private function for easier testing.dataset
as an explicit param toActivationStore
constructor, to allow for testing with a small dataset that the individual tests can control and make assertions against.Happy to change or remove any of this if it's not what's desired!