Skip to content

Commit

Permalink
Merge branch 'main' into intiPattern
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamondJoseph authored May 2, 2024
2 parents e458f09 + b5df007 commit c0072a7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ophyd_async/epics/_backend/_p4p.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,13 @@ def make_converter(datatype: Optional[Type], values: Dict[str, Any]) -> PvaConve
)
return PvaEnumConverter(get_supported_enum_class(pv, datatype, pv_choices))
elif "NTScalar" in typeid:
if datatype and not issubclass(typ, datatype):
if (
datatype
and not issubclass(typ, datatype)
and not (
typ is float and datatype is int
) # Allow float -> int since prec can be 0
):
raise TypeError(f"{pv} has type {typ.__name__} not {datatype.__name__}")
return PvaConverter()
elif "NTTable" in typeid:
Expand Down

0 comments on commit c0072a7

Please sign in to comment.