pasqal-io / Pulser

Library for pulse-level/analog control of neutral atom devices. Emulator with QuTiP.
Apache License 2.0
159 stars 57 forks source link

Optionally skip JSON schema validation after serialization #693

Closed HGSilveri closed 2 weeks ago

HGSilveri commented 2 weeks ago

Closes #689 .

HGSilveri commented 2 weeks ago

LGTM. My only suggetion would be to clarify in the docstring when it can be fine to skip the validation and maybe also mention the associated performance gains

Thank you @MatthieuMoreau0 ! What do you think of this for the docstring?

            skip_validation: Whether to skip the validation of the serialized
                sequence against the abstract representation's JSON schema.
                Skipping the validation is useful to cut down on execution
                time, as this step takes significantly longer than the
                serialization itself; it is also low risk, as the validation
                is only defensively checking that there are no bugs in the
                serialized sequence.
MatthieuMoreau0 commented 2 weeks ago

LGTM. My only suggetion would be to clarify in the docstring when it can be fine to skip the validation and maybe also mention the associated performance gains

Thank you @MatthieuMoreau0 ! What do you think of this for the docstring?

            skip_validation: Whether to skip the validation of the serialized
                sequence against the abstract representation's JSON schema.
                Skipping the validation is useful to cut down on execution
                time, as this step takes significantly longer than the
                serialization itself; it is also low risk, as the validation
                is only defensively checking that there are no bugs in the
                serialized sequence.

Looks good!