@@ -138,8 +138,8 @@ def read(
138138 return result
139139
140140
141- def write (
142- file : Union [ str , bytes , PathLike [ Any ], BinaryIO ] ,
141+ def to_file (
142+ file : _FileLike ,
143143 data : pd .DataFrame ,
144144 address : int ,
145145 dtype : Optional [np .dtype ] = None ,
@@ -152,7 +152,7 @@ def write(
152152 Parameters
153153 ----------
154154 file
155- Open file object or filename where to store binary data from
155+ File path, or open file object in which to store binary data from
156156 a single device register.
157157 data
158158 Pandas data frame containing message payload.
@@ -170,19 +170,19 @@ def write(
170170 Optional message type used for all formatted Harp messages.
171171 If not specified, data must contain a MessageType column.
172172 """
173- buffer = format (data , address , dtype , port , epoch , message_type )
173+ buffer = to_buffer (data , address , dtype , port , epoch , message_type )
174174 buffer .tofile (file )
175175
176176
177- def format (
177+ def to_buffer (
178178 data : pd .DataFrame ,
179179 address : int ,
180180 dtype : Optional [np .dtype ] = None ,
181181 port : Optional [int ] = None ,
182182 epoch : Optional [datetime ] = None ,
183183 message_type : Optional [MessageType ] = None ,
184184) -> npt .NDArray [np .uint8 ]:
185- """Format single-register Harp data as a flat binary buffer.
185+ """Convert single-register Harp data to a flat binary buffer.
186186
187187 Parameters
188188 ----------
0 commit comments