diff --git a/src/robofish/io/__init__.py b/src/robofish/io/__init__.py index 4038229f4491f8863b8204c3658f6b448892f8f9..5b054c2fb71018dd23ceb315d83bf83f51cc1cac 100644 --- a/src/robofish/io/__init__.py +++ b/src/robofish/io/__init__.py @@ -1,7 +1,7 @@ # SPDX-License-Identifier: LGPL-3.0-or-later """ -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 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 world information and movement tracks of entities (organisms, robots, obstacles,...). 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 diff --git a/src/robofish/io/file.py b/src/robofish/io/file.py index c805381ab2782c0be5841ccc0a000b74f8eb87ea..14d2a4d1d3f2aec3253e84d6733c4ae3b6b6851a 100644 --- a/src/robofish/io/file.py +++ b/src/robofish/io/file.py @@ -315,7 +315,7 @@ class File(h5py.File): Args: TODO - category: the of the entity. The canonical values are ['fish', 'robot', 'obstacle']. + category: the of the entity. The canonical values are ['organism', 'robot', 'obstacle']. poses: optional two dimensional array, containing the poses of the entity (x,y,orientation_x, orientation_y). poses_rad: optional two dimensional containing the poses of the entity (x,y, orientation_rad). name: optional name of the entity. If no name is given, the is used with an id (e.g. 'fish_1') @@ -353,7 +353,7 @@ class File(h5py.File): """Creates multiple entities. Args: - category: The common category for the entities. The canonical values are ['fish', 'robot', 'obstacle']. + category: The common category for the entities. The canonical values are ['organism', 'robot', 'obstacle']. poses: three dimensional array, containing the poses of the entity. name: optional array of names of the entities. If no names are given, the category is used with an id (e.g. 'fish_1') outlines: optional array, containing the outlines of the entities, either a three dimensional common outline array can be given, or a four dimensional array. diff --git a/tests/robofish/io/test_entity.py b/tests/robofish/io/test_entity.py index 17fdcd259e49735c1cbea607ef2cd9ae67be5d7b..72dc5f7efe8a0ed1296a66f39473e575230dd123 100644 --- a/tests/robofish/io/test_entity.py +++ b/tests/robofish/io/test_entity.py @@ -6,9 +6,9 @@ import numpy as np def test_entity_object(): sf = robofish.io.File(world_size_cm=[100, 100], frequency_hz=25) f = sf.create_entity("fish", positions=[[10, 10]]) - assert type(f) == robofish.io.Entity - assert f.name == "fish_1" - assert f.attrs["category"] == "fish" + assert type(f) == robofish.io.Entity, "Type of entity was wrong" + assert f.name == "fish_1", "Name of entity was wrong" + assert f.attrs["category"] == "fish", "category was wrong" print(dir(f)) print(f["positions"]) assert type(f["positions"]) == h5py.Dataset