Skip to content

Commit c2413ca

Browse files
committed
The field timestemp has been renamed to utc_timestamp in the backend
Signed-off-by: Cédric Foellmi <cedric@onekiloparsec.dev>
1 parent d65dd7b commit c2413ca

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

arcsecond/cloud/uploader/allskycameraimages/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ def __init__(self, camera_uuid, org_subdomain, message):
1515

1616
class MissingTimestampError(ArcsecondError):
1717
def __init__(self, filename):
18-
msg = f"Missing timestamp for camera image {filename}."
18+
msg = f"Missing UTC timestamp for camera image {filename}."
1919
super().__init__(msg)

arcsecond/cloud/uploader/allskycameraimages/uploader.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ def _prepare_upload(self):
1616
def _get_upload_data(self, **kwargs):
1717
# At that point, timestamp must have been provided (with upload_file(ts)).
1818
fields = {"camera": self._context.camera_uuid}
19-
clean_kwargs = {k: kwargs[k] for k in ("timestamp", "camera") if k in kwargs}
19+
clean_kwargs = {k: kwargs[k] for k in ("utc_timestamp", "camera") if k in kwargs}
2020
fields.update(**clean_kwargs)
2121
return fields
2222

23-
def upload_file(self, timestamp, **kwargs):
24-
if timestamp is None:
23+
def upload_file(self, utc_timestamp, **kwargs):
24+
if utc_timestamp is None:
2525
raise MissingTimestampError(self._file_path)
26-
kwargs.update(timestamp=timestamp)
26+
kwargs.update(utc_timestamp=utc_timestamp)
2727
return super().upload_file(**kwargs)

examples/example_upload_images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
uploader = AllSkyCameraImageFileUploader(context, filepath, display_progress=False)
1818
# You must provide timestamp for every file. Below is just an example for tests.
1919
timestamp = datetime.now(timezone.utc).timestamp() # random.randint(0, 1000)
20-
status, substatus, error = uploader.upload_file(timestamp=timestamp)
20+
status, substatus, error = uploader.upload_file(utc_timestamp=timestamp)
2121
print(status, substatus, error)

0 commit comments

Comments
 (0)