Skip to content

Commit

Permalink
Remove pytable import from pedpy requirements (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
schroedtert authored Sep 14, 2023
1 parent 292df7e commit cbc685a
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:
- name: Install wheel
shell: bash
run: |
python3 -m pip install --upgrade pip jupyter nbconvert nbformat matplotlib h5py
python3 -m pip install --upgrade pip jupyter nbconvert nbformat matplotlib h5py tables
python3 -m pip install dist/*whl
- name: Test if install was successful
Expand Down
3 changes: 2 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ sphinx-notfound-page==0.8.3
sphinx-favicon==1.0.1
sphinx-book-theme==1.0.1
sphinx-autoapi==2.1.1
h5py==3.9.0
h5py~=3.9.0
tables~=3.8.0
8 changes: 8 additions & 0 deletions notebooks/getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"execution_count": null,
"id": "ba3330b8828e94e2",
"metadata": {
"ExecuteTime": {
"end_time": "2023-09-11T09:20:17.991484381Z",
"start_time": "2023-09-11T09:20:17.985395162Z"
},
"collapsed": false,
"tags": [
"remove_input"
Expand Down Expand Up @@ -93,6 +97,10 @@
"execution_count": null,
"id": "190bcba420e16730",
"metadata": {
"ExecuteTime": {
"end_time": "2023-09-11T09:20:40.405073444Z",
"start_time": "2023-09-11T09:20:37.866263207Z"
},
"collapsed": false
},
"outputs": [],
Expand Down
65 changes: 40 additions & 25 deletions notebooks/user_guide.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"#### Loading from text trajectory files\n",
"\n",
Expand Down Expand Up @@ -306,14 +309,14 @@
"\n",
"If your data is structured in a different way please take a look at the next section.\n",
"Since the data we want to analyze is from the data archive, we can directly load the {class}`trajectory data<trajectory_data.TrajectoryData>` with *PedPy*: "
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"from pedpy import load_trajectory, TrajectoryUnit\n",
Expand All @@ -323,56 +326,71 @@
" default_unit=TrajectoryUnit.METER, # needs to be provided as it not defined in the file\n",
" # default_frame_rate=25., # can be ignored here as the frame rate is defined in the file\n",
")"
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "markdown",
"source": [
"The loaded {class}`trajectory data<trajectory_data.TrajectoryData>` look like:"
],
"metadata": {
"collapsed": false
}
},
"source": [
"The loaded {class}`trajectory data<trajectory_data.TrajectoryData>` look like:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"from pedpy import plot_trajectories\n",
"import matplotlib.pyplot as plt\n",
"\n",
"plot_trajectories(traj=traj).set_aspect(\"equal\")\n",
"plt.show()"
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"#### Loading from hdf5 trajectory files\n",
"\n",
"For some experiments the [Jülich Data Archive](https://ped.fz-juelich.de/da/doku.php) also provides [HDF5](https://www.google.com/search?client=firefox-b-d&q=hdf5) trajectory files, with a structure described [here](https://ped.fz-juelich.de/da/doku.php?id=info).\n",
"For some experiments the [Jülich Data Archive](https://ped.fz-juelich.de/da/doku.php) also provides [HDF5](www.hdfgroup.org/HDF5) trajectory files, with a structure described [here](https://ped.fz-juelich.de/da/doku.php?id=info).\n",
"These data are from a different experiment, and are only used to demonstrate how to load HDF5 files, it can be downloaded {download}`here <demo-data/single_file/00_01a.h5>` For this to work you need to install the `h5py` package via:\n",
"\n",
"```\n",
"pip install h5py\n",
"```\n",
"\n",
"Also Pandas needs [PyTables]() to load HDF5 files directly.\n",
"It can be installed via:\n",
"\n",
"```\n",
"pip install tables\n",
"```\n",
"\n",
"If you are using a Mac with an ARM processor, there is some extra work to do. \n",
"First you need to install the [HDF5 library](https://www.hdfgroup.org/solutions/hdf5/), if you have [Homebrew](https://brew.sh/) installed, you may use `brew install hdf5`.\n",
"Afterward, you can install PyTables with:\n",
"\n",
"```\n",
"pip install git+https://github.com/PyTables/PyTables\n",
"```\n",
"\n",
"To make the data usable for *PedPy* use:"
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"from pedpy import TrajectoryData\n",
Expand All @@ -388,10 +406,7 @@
"\n",
"traj_h5 = TrajectoryData(data=df_trajectory, frame_rate=frame_rate)\n",
"traj_h5"
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "markdown",
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pandas~=2.0
Shapely~=2.0
scipy~=1.11
matplotlib~=3.7
tables~=3.8.0

# testing
pytest~=7.4
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,5 @@
"Shapely~=2.0",
"scipy~=1.11",
"matplotlib~=3.7",
"tables~=3.8",
],
)

0 comments on commit cbc685a

Please sign in to comment.