Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapter: Minor fixes and more thorough testing #317

Merged
merged 3 commits into from
Feb 14, 2025

Conversation

vpratz
Copy link
Collaborator

@vpratz vpratz commented Feb 13, 2025

This PR expands the tests for the Adapter and fixes some problems encountered in those tests:

  • Check the cycle and output serialization consistency for an adapter that has already seen data (was without data before), 17083e4
  • expand tested adapter to include all built-in transforms (at least all functions, not all functionality is tested yet), 6389db6
  • fixes Keras-induced tuple to list conversion problems during deserialization
  • fixes a small bug in LambdaTransform and allows serialization of the transform_constructor, 4839fd6

* The deserialize call for `kwargs` was missing.
* The constructor can be (de)serialized using get_registered_name and
  get_registered_object

Added meaningful error message, if functions are not registered and not
passed as custom objects.
Keras deserializes tuples as lists. This can cause problems, and has to
be undone manually.
* also, expand test to ensure consistency of outputs before and after
  serialization
@vpratz vpratz requested a review from LarsKue February 13, 2025 13:19
@codecov-commenter
Copy link

codecov-commenter commented Feb 13, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 75.00000% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
bayesflow/adapters/transforms/filter_transform.py 42.85% 4 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Files with missing lines Coverage Δ
bayesflow/adapters/transforms/broadcast.py 85.45% <100.00%> (+60.96%) ⬆️
bayesflow/adapters/transforms/standardize.py 97.43% <100.00%> (+0.21%) ⬆️
bayesflow/adapters/transforms/filter_transform.py 55.23% <42.85%> (+2.23%) ⬆️

... and 9 files with indirect coverage changes

@stefanradev93 stefanradev93 merged commit e691644 into bayesflow-org:dev Feb 14, 2025
13 checks passed
@vpratz vpratz deleted the test-adapter branch February 14, 2025 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants