Skip to content

Commit

Permalink
Fix spelling of (de-)serialization and (un-)structuring
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSosic committed Nov 14, 2024
1 parent 7260d02 commit a47821e
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Simulation no longer fails for targets in `MATCH` mode
- `closest_element` now works for array-like input of all kinds
- Structuring concrete subclasses no longer requires providing an explicit `type` field
- `_target(s)` attributes of `Objectives` are now de-/serialized without leading
- `_target(s)` attributes of `Objectives` are now (de-)serialized without leading
underscore to support user-friendly serialization strings
- Telemetry does not execute any code if it was disabled
- Running simulations no longer alters the states of the global random number generators
Expand Down Expand Up @@ -439,7 +439,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `mypy` for targets and intervals
- Tests for code blocks in README and user guides
- `hypothesis` strategies and roundtrip tests for targets, intervals, and dataframes
- De-/serialization of target subclasses via base class
- (De-)serialization of target subclasses via base class
- Docs building check now part of CI
- Automatic formatting checks for code examples in documentation
- Deserialization of classes with classmethod constructors can now be customized
Expand All @@ -464,7 +464,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Use pydoclint as flake8 plugin and not as a stand-alone linter
- Margins in documentation for desktop and mobile version
- `Interval`s can now also be deserialized from a bounds iterable
- `SubspaceDiscrete` and `SubspaceContinuous` now have de-/serialization methods
- `SubspaceDiscrete` and `SubspaceContinuous` now have (de-)serialization methods

### Removed
- Conda install instructions and version badge
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Besides functionality to perform a typical recommend-measure loop, BayBE's highl
- ⚙️ Custom surrogate models: Enhance your predictions through mechanistic understanding
- 📈 Comprehensive backtest, simulation and imputation utilities: Benchmark and find your best settings
- 📝 Fully typed and hypothesis-tested: Robust code base
- 🔄 All objects are fully de-/serializable: Useful for storing results in databases or use in wrappers like APIs
- 🔄 All objects are fully (de-)serializable: Useful for storing results in databases or use in wrappers like APIs


## ⚡ Quick Start
Expand Down
2 changes: 1 addition & 1 deletion baybe/acquisition/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def _get_botorch_acqf_class(
)


# Register de-/serialization hooks
# Register (un-)structure hooks
def _add_deprecation_hook(hook):
"""Add deprecation warnings to the default hook.
Expand Down
2 changes: 1 addition & 1 deletion baybe/campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def _drop_version(dict_: dict) -> dict:
return dict_


# Register de-/serialization hooks
# Register (un-)structure hooks
unstructure_hook = cattrs.gen.make_dict_unstructure_fn(
Campaign, converter, _cattrs_include_init_false=True
)
Expand Down
2 changes: 1 addition & 1 deletion baybe/kernels/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class CompositeKernel(Kernel, ABC):
"""Abstract base class for all composite kernels."""


# Register de-/serialization hooks
# Register (un-)structure hooks
converter.register_structure_hook(Kernel, get_base_structure_hook(Kernel))
converter.register_unstructure_hook(Kernel, unstructure_base)

Expand Down
2 changes: 1 addition & 1 deletion baybe/objectives/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def to_objective(x: Target | Objective, /) -> Objective:
return x if isinstance(x, Objective) else x.to_objective()


# Register de-/serialization hooks
# Register (un-)structure hooks
converter.register_structure_hook(Objective, structure_objective)
converter.register_unstructure_hook(
Objective,
Expand Down
2 changes: 1 addition & 1 deletion baybe/priors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def to_gpytorch(self, *args, **kwargs):
return prior_cls(*args, **kwargs)


# Register de-/serialization hooks
# Register (un-)structure hooks
converter.register_structure_hook(Prior, get_base_structure_hook(Prior))
converter.register_unstructure_hook(Prior, unstructure_base)

Expand Down
2 changes: 1 addition & 1 deletion baybe/serialization/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def select_constructor_hook(specs: dict, cls: type[_T]) -> _T:
return converter.structure_attrs_fromdict(specs, cls)


# Register custom un-/structure hooks
# Register custom (un-)structure hooks
converter.register_unstructure_hook(pd.DataFrame, _unstructure_dataframe_hook)
converter.register_structure_hook(pd.DataFrame, _structure_dataframe_hook)
converter.register_unstructure_hook(datetime, lambda x: x.isoformat())
Expand Down
2 changes: 1 addition & 1 deletion baybe/surrogates/gaussian_process/kernel_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __call__(
...


# Register de-/serialization hooks
# Register (un-)structure hooks
converter.register_structure_hook(KernelFactory, get_base_structure_hook(KernelFactory))
converter.register_unstructure_hook(KernelFactory, unstructure_base)

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/campaigns.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ This requirement can be disabled using the method's

## Serialization

Like other BayBE objects, [`Campaigns`](baybe.campaign.Campaign) can be de-/serialized
Like other BayBE objects, [`Campaigns`](baybe.campaign.Campaign) can be (de-)serialized
using their [`from_json`](baybe.serialization.mixin.SerialMixin.from_json)/
[`to_json`](baybe.serialization.mixin.SerialMixin.to_json) methods, which
allow to convert between Python objects and their corresponding representation in JSON
Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ Find a detailed example [here](../../examples/Constraints_Discrete/custom_constr

```{warning}
Due to the arbitrary nature of code and dependencies that can be used in the
`DiscreteCustomConstraint`, de-/serializability cannot be guaranteed. As a consequence,
`DiscreteCustomConstraint`, (de-)serializability cannot be guaranteed. As a consequence,
using a `DiscreteCustomConstraint` results in an error if you attempt to serialize
the corresponding object or higher-level objects containing it.
```
2 changes: 1 addition & 1 deletion docs/userguide/recommenders.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ recommender = TwoPhaseMetaRecommender(
enables the utilization of *arbitrary* iterables to select recommender.

```{warning}
Due to the arbitrary nature of iterables that can be used, de-/serializability cannot
Due to the arbitrary nature of iterables that can be used, (de-)serializability cannot
be guaranteed. As a consequence, using a `StreamingSequentialMetaRecommender` results
in an error if you attempt to serialize the corresponding object or higher-level
objects containing it.
Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ i.e., reassembling the corresponding Python object from its serialization string
```

(JSON_SERIALIZATION)=
## JSON de-/serialization
## JSON (de-)serialization
Most BayBE objects can be conveniently serialized into an equivalent JSON
representation by calling their
{meth}`to_json <baybe.serialization.mixin.SerialMixin.to_json>` method.
Expand Down
2 changes: 1 addition & 1 deletion examples/Serialization/Serialization_Header.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Serialization

These examples demonstrate BayBE's de-/serialization capabilities.
These examples demonstrate BayBE's (de-)serialization capabilities.

0 comments on commit a47821e

Please sign in to comment.