Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
io
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
bioroboticslab
robofish
io
Commits
bca75e0b
Commit
bca75e0b
authored
4 years ago
by
laxap
Browse files
Options
Downloads
Patches
Plain Diff
update file.py docstring
parent
a5257972
No related branches found
No related tags found
No related merge requests found
Pipeline
#37217
passed
4 years ago
Stage: package
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/robofish/io/file.py
+54
-15
54 additions, 15 deletions
src/robofish/io/file.py
with
54 additions
and
15 deletions
src/robofish/io/file.py
+
54
−
15
View file @
bca75e0b
...
@@ -30,6 +30,7 @@ import uuid
...
@@ -30,6 +30,7 @@ import uuid
import
deprecation
import
deprecation
import
types
import
types
# Remember: Update docstring when updating these two global variables
default_format_version
=
np
.
array
([
1
,
0
],
dtype
=
np
.
int32
)
default_format_version
=
np
.
array
([
1
,
0
],
dtype
=
np
.
int32
)
default_format_url
=
(
default_format_url
=
(
...
@@ -61,26 +62,64 @@ class File(h5py.File):
...
@@ -61,26 +62,64 @@ class File(h5py.File):
):
):
"""
Create a new RoboFish Track Format object.
"""
Create a new RoboFish Track Format object.
When called with a path, it is loaded, otherwise a new temporary file is created.
When called with a path, it is loaded, otherwise a new temporary
file is created. File contents can be validated against the
track format specification.
Parameters
Parameters
----------
----------
path : str or Path, optional
path : str or Path, optional
Location of file to be opened. If not provided, mode is ignored.
Location of file to be opened. If not provided, mode is ignored.
mode : str, default=
'
r
'
mode : str
'
r
'
Readonly, file must exist
r Readonly, file must exist (default)
'
r+
'
Read/write, file must exist
r+ Read/write, file must exist
'
w
'
Create file, truncate if exists
w Create file, truncate if exists
'
x
'
Create file, fail if exists
x Create file, fail if exists
'
a
'
Read/write if exists, create otherwise
a Read/write if exists, create otherwise
world_size_cm : [int, int] , optional
side lengths [x, y] of the world in cm.
world_size_cm
rectangular world shape is assumed.
optional integer array of the world size in cm
TODO: Cuboid world is also possible in track format
strict_validate
strict_validate : bool, default=False
optional boolean, if the file should be strictly validated, when loaded from a path. The default is False.
if the file should be strictly validated against the track
format_version
format specification, when loaded from a path.
optional version [major, minor] of the trackformat specification
TODO: Should this validate against the version sepcified in
format_version or just against the most recent version?
format_version : [int, int], default=[1,0]
version [major, minor] of track format specification
format_url : str, default=
"
https://git.imp.fu-berlin.de/bioroboticslab/robofish/track_format/-/releases/1.0
"
location of track format specification.
should fit `format_version`.
sampling_name : str, optional
How to specify your sampling:
1. (optional)
provide text description of your sampling in `sampling_name`
2.a (mandatory, if you have a constant sampling frequency)
specify `frequency_hz` with your sampling frequency in Hz
2.b (mandatory, if you do NOT have a constant sampling frequency)
specify `monotonic_time_points_us` with a list[1] of time
points in microseconds on a montonic clock, one for each
sample in your dataset.
3. (optional)
specify `calendar_time_points` with a list[2] of time points
in the ISO 8601 extended format with microsecond precision
and time zone designator[3], one for each sample in your
dataset.
[1] any Iterable of int
[2] any Iterable of str
[3] example:
"
2020-11-18T13:21:34.117015+01:00
"
frequency_hz: int, optional
refer to explanation of `sampling_name`
monotonic_time_points_us: Iterable of int, optional
refer to explanation of `sampling_name`
calendar_time_points: Iterable of str, optional
refer to explanation of `sampling_name`
"""
"""
if
path
is
None
:
if
path
is
None
:
...
...
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