Skip to content
Snippets Groups Projects
Commit fa516a86 authored by Andi Gerken's avatar Andi Gerken
Browse files

Added some doc details

Added buttons to link between docs and code
Changed required h5py version to 3.2.1 to prevent bugs
parent eff67d45
No related branches found
No related tags found
No related merge requests found
Pipeline #37236 passed
......@@ -12,6 +12,34 @@
This repository implements an easy to use interface, to create, save, load, and work with [specification-compliant](https://git.imp.fu-berlin.de/bioroboticslab/robofish/track_format) hdf5 files, containing 2D swarm data. This repository should be used by the different swarm projects to generate comparable standardized files.
<a href="http://agerken.de/io/index.html" class="myButton">Documentation</a>
<style>
.myButton {
background:#3971cc;
background-color:#3971cc;
border-radius:9px;
display:inline-block;
cursor:pointer;
color:#ffffff;
font-family:Arial;
font-size:20px;
padding:8px 16px;
text-decoration:none;
}
.myButton:hover {
background:#396bd1;
background-color:#396bd1;
color: #e0e0e0;
text-decoration: none;
}
.myButton:active {
position:relative;
top:1px;
}
</style>
## Installation
Add our [Artifacts repository](https://git.imp.fu-berlin.de/bioroboticslab/robofish/artifacts) to your pip config and install the packagage.
......@@ -21,8 +49,6 @@ python3 -m pip config set global.extra-index-url https://git.imp.fu-berlin.de/ap
python3 -m pip install robofish-io
```
## Usage
We show a simple example below. More examples can be found in ```examples/```
......@@ -74,13 +100,3 @@ Current modes are:
- tank_positions
- trajectories
- follow_iid
\ No newline at end of file
## LICENSE
This work is licensed under LGPL 3.0 (or any later version).
Individual files contain the following tag instead of the full license text:
`SPDX-License-Identifier: LGPL-3.0-or-later`
This enables machine processing of license information based on the SPDX License Identifiers available here: https://spdx.org/licenses/
......@@ -54,7 +54,7 @@ nemo.attrs["fish_standard_length_cm"] = 10
```
Any attribute is allowed, but some cannonical attributes are prepared:<br>
`species`: str, `sex`: str, `fish_standard_length_cm`: float
`species`:`str`, `sex`:`str`, `fish_standard_length_cm`:`float`
## Properties
......
......@@ -10,8 +10,6 @@ f = robofish.io.File(world_size_cm=[100, 100], frequency_hz=25.0)
f.save_as("test.hdf5")
```
---
The File object can also be generated, with a given path. In this case, we work on the file directly. The `with` block ensures, that the file is validated after the block.
```python
......@@ -31,7 +29,7 @@ When opening a file with a path, a mode should be specified to describe how the
| x | Create file, fail if exists |
| a | Read/write if exists, create otherwise |
---
## Attributes
Attributes of the file can be added, to describe the contents.
The attributes can be set like this:
......@@ -43,6 +41,5 @@ f.attrs["experiment_issues"] = "All data in this file is made up."
Any attribute is allowed, but some cannonical attributes are prepared:<br>
`publication_url, video_url, tracking_software_name, tracking_software_version, tracking_software_url, experiment_setup, experiment_issues`
---
All file functions and their documentation can be found at `robofish.io.file.File`.
\ No newline at end of file
## Properties
As described in `robofish.io`, all properties of `robofish.io.entity.Entity`s can be accessed by adding the prefix `entity_` to the function.
\ No newline at end of file
testtesttest
\ No newline at end of file
......@@ -4,7 +4,8 @@ This package provides you:
- Preprocessing (orientation calculation, action calculation, raycasting, ...)
- Quick and easy evaluation of behavior
- Data, which is interchangable between labs and tools. No conversions required, since units and coordinate systems are standardized.
- No custom data import, but just `include robofish.io`
- No custom data import, just `include robofish.io`
- This package is tested extensively
Features coming up:
......@@ -12,6 +13,33 @@ Features coming up:
- Pytorch Datasets directly from `robofish.io` files.
<a href="https://git.imp.fu-berlin.de/bioroboticslab/robofish/io" class="myButton">Code</a>
<style>
.myButton {
background:#3971cc;
background-color:#3971cc;
border-radius:9px;
display:inline-block;
cursor:pointer;
color:#ffffff;
font-family:Arial;
font-size:20px;
padding:8px 16px;
text-decoration:none;
}
.myButton:hover {
background:#396bd1;
background-color:#396bd1;
color: #e0e0e0;
text-decoration: none;
}
.myButton:active {
position:relative;
top:1px;
}
</style>
## Installation
Add our [Artifacts repository](https://git.imp.fu-berlin.de/bioroboticslab/robofish/artifacts) to your pip config and install the packagage.
......@@ -22,8 +50,8 @@ python3 -m pip install robofish-io robofish-trackviewer
## Usage
This documentation is structured to increase in complexity.
First we'll execute the example from the README. More examples can be found in ```examples/```.
This documentation is structured with increasing complexity.
First we'll execute the example from the readme. More examples can be found in ```examples/```.
```python
# Create a new robofish io file
......@@ -123,7 +151,7 @@ In the same scheme the following properties are available:
| File/ Entity function | Description |
|--------------------------------- |------------------------------------------------------------------------------------------------------- |
| --------------------- | ----------- ||
| *entity_*positions | The positions as a (*entities*, timesteps, 2 (x, y)) arary. |
| *entity_*orientations | The orientations as a (*entities*, timesteps, 2 (ori_x, ori_y)) arary. |
| *entity_*orientations_rad | The orientations as a (*entities*, timesteps, 1 (ori_rad)) arary. |
......@@ -132,10 +160,26 @@ In the same scheme the following properties are available:
| *entity_*poses_calc_ori_rad | The poses with calculated orientations as a<br>(*entities*, timesteps - 1, 3 (x, y, calc_ori_rad)) array. |
| *entity_*speed_turn | The speed and turn as a (*entities*, timesteps - 2, 2 (speed_cm/s, turn_rad/s)) array. |
The functions `robofish.io.entity.Entity.poses_calc_ori_rad` and `robofish.io.entity.Entity.speed_turn` are described in detail in `robofish.io.entity`
All these functions are described in more detail in `robofish.io.entity`.
## Where to continue?
We recommend continuing to read advanced options for `robofish.io.file`s and `robofish.io.entity`s.
Create some files, validate them, look at them in the trackviewer, evaluate them.
If you find bugs or get stuck somewhere, please text `Andi` on Mattermost or by mail (andi.gerken@gmail.com)
\ No newline at end of file
If you find bugs or get stuck somewhere, please text `Andi` on Mattermost or by mail ([andi.gerken@gmail.com](mailto:andi.gerken@gmail.com))
---
## Extended functions
In the [Track Format Specification](https://git.imp.fu-berlin.de/bioroboticslab/robofish/track_format/uploads/f76d86e7a629ca38f472b8f23234dbb4/RoboFish_Track_Format_-_1.0.pdf) and in this package there are more possibilities, we don't describe explicitly here. If you want to use any of the following features, please ask Andi:
Built in robofish.io and not described:
- Multiple sampling frequencies
- Timestamps per timestep
- Calendar points
- Outlines
- Obstacles
Planned in Track Format but not implemented:
- 3D Tracks
\ No newline at end of file
......@@ -48,7 +48,7 @@ setup(
version=source_version(),
author="",
author_email="",
install_requires=["h5py>=2.10.0", "numpy", "seaborn", "pandas", "deprecation"],
install_requires=["h5py>=3.2.1", "numpy", "seaborn", "pandas", "deprecation"],
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
......
# SPDX-License-Identifier: LGPL-3.0-or-later
"""
The Python package `robofish.io` provides a simple interface to create, load, modify, and inspect files containing tracks of swarms.
The files are saved in the `.hdf5` format and following the [track_format specification](https://git.imp.fu-berlin.de/bioroboticslab/robofish/track_format/uploads/f76d86e7a629ca38f472b8f23234dbb4/RoboFish_Track_Format_-_1.0.pdf).
The Python package <a href="https://git.imp.fu-berlin.de/bioroboticslab/robofish/io">robofish.io</a> provides a simple interface to create, load, modify, and inspect files containing tracks of swarms.
The files are saved in the `.hdf5` format and following the [Track Format Specification](https://git.imp.fu-berlin.de/bioroboticslab/robofish/track_format/uploads/f76d86e7a629ca38f472b8f23234dbb4/RoboFish_Track_Format_-_1.0.pdf).
.. include:: ../../../docs/index.md
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment