Skip to content

Commit

Permalink
fix: Dump kernels directly in json
Browse files Browse the repository at this point in the history
  • Loading branch information
alecandido committed Aug 12, 2024
1 parent 922d49d commit a8e7b55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/qibolab/components/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@

from typing import Annotated, Literal, Optional, Union

import numpy.typing as npt
from pydantic import Field

from qibolab.serialize_ import Model
from qibolab.serialize_ import Model, NdArray

__all__ = [
"DcConfig",
Expand Down Expand Up @@ -95,7 +94,7 @@ class AcquisitionConfig(Model):
iq_angle: Optional[float] = None
"""Signal angle in the IQ-plane for disciminating ground and excited
states."""
kernel: Annotated[Optional[npt.NDArray], Field(default=None, repr=False)]
kernel: Annotated[Optional[NdArray], Field(repr=False)] = None
"""Integration weights to be used when post-processing the acquired
signal."""

Expand Down
4 changes: 1 addition & 3 deletions src/qibolab/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from pydantic import Field, TypeAdapter

from qibolab.components import AcquisitionConfig, Config
from qibolab.components import Config
from qibolab.execution_parameters import ConfigUpdate, ExecutionParameters
from qibolab.kernels import Kernels
from qibolab.native import (
Expand Down Expand Up @@ -246,8 +246,6 @@ def _dump_component_configs(component_configs) -> dict:
components = {}
for name, cfg in component_configs.items():
components[name] = cfg.model_dump()
if isinstance(cfg, AcquisitionConfig):
del components[name]["kernel"]
return components


Expand Down

0 comments on commit a8e7b55

Please sign in to comment.