Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
calibration
pycalibration
Commits
525482b5
Commit
525482b5
authored
1 year ago
by
Thomas Kluyver
Browse files
Options
Downloads
Patches
Plain Diff
Reject time parameters that are not datetime, date or string
parent
0399fbb3
No related branches found
No related tags found
1 merge request
!885
Revised CalCat API
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cal_tools/calcat_interface2.py
+5
-0
5 additions, 0 deletions
src/cal_tools/calcat_interface2.py
with
5 additions
and
0 deletions
src/cal_tools/calcat_interface2.py
+
5
−
0
View file @
525482b5
...
@@ -57,6 +57,11 @@ class CalCatAPIClient:
...
@@ -57,6 +57,11 @@ class CalCatAPIClient:
return
dt
.
astimezone
(
timezone
.
utc
).
isoformat
()
return
dt
.
astimezone
(
timezone
.
utc
).
isoformat
()
elif
isinstance
(
dt
,
date
):
elif
isinstance
(
dt
,
date
):
return
cls
.
format_time
(
datetime
.
combine
(
dt
,
time
()))
return
cls
.
format_time
(
datetime
.
combine
(
dt
,
time
()))
elif
not
isinstance
(
dt
,
str
):
raise
TypeError
(
f
"
Timestamp parameter (
{
dt
!r}
) must be a string, datetime or
"
f
"
date object
"
)
return
dt
return
dt
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment