-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Continuity equation and fundamental diagram of pedestrians #242
base: main
Are you sure you want to change the base?
Conversation
…meassurement line
…e_species_with_traj
calculate speed in movement direction using compute_individual_speed, use tuple instead dict for tests
infer_objects() converts columns to appropriate data types while preserving NaN values
during the addition of line quantities, especially when there is only one direction, this is often the case.
- use cdot instead of * to refer to multiplication - use proper intersection symbol - flow formula had an error (should devise by A (area) not V)
- For compute_line_speed - Add tests
pedpy/data/geometry.py
Outdated
@@ -313,6 +314,16 @@ def line(self): | |||
""" | |||
return self._line | |||
|
|||
def normal_vector(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return type missing. Thought this would be caught be some linter or mypy...
pedpy/data/geometry.py
Outdated
@@ -313,6 +314,16 @@ def line(self): | |||
""" | |||
return self._line | |||
|
|||
def normal_vector(self): | |||
"""Returns a normalized normal vector of the line.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docstring not complete, should als contain a description of the return value, e.g.,
"""Measurement line as :class:`shapely.LineString`.
Returns:
Measurement line as :class:`shapely.LineString`.
"""
pedpy/methods/flow_calculator.py
Outdated
individual_speed: pd.DataFrame, | ||
species: pd.DataFrame, | ||
) -> None: | ||
"""Centralize input validation with clear error messages.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to explain what is checked here in the docstring.
pedpy/methods/speed_calculator.py
Outdated
individual_speed: pd.DataFrame, | ||
species: pd.DataFrame, | ||
) -> None: | ||
"""Centralize input validation with clear error messages.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, a little more information in the docstring would be nice
pedpy/methods/method_utils.py
Outdated
"""Applies lambda for both species for frames where Polygon intersects line. | ||
|
||
lambda_for_group is called with a group containing | ||
the data of one species and a Measurement Line. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A proper docstring would be nice here too, this is used at multiple places and may be reused by other methods as well
docs/source/methods/index.rst
Outdated
.. list-table:: | ||
:widths: 20 80 | ||
|
||
* - :doc:`CECM <../CECM>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use the same heading as in the notebooks: Fundamental Diagrams at Measurement Lines. Then it is consistent and more understandable. CECM was a working name, not sure if somebody knows what it stands for.
notebooks/CECM.ipynb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rename the file to match its title: fundamental_diagrams_at_measurement_lines. Also update the link in the docs
notebooks/CECM.ipynb
Outdated
"j^S(t) = \\sum_{i \\in S} m_i \\cdot v_i(t) \\cdot n_{l} \\cdot \\frac{1}{A_i(t)} \\cdot \\frac{w_i(t)}{w}\n", | ||
"$$\n", | ||
"\n", | ||
"### Explanation of Symbols\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it on purpose, that this is a subsection of "Compute Line flow"?
docs/source/methods/index.rst
Outdated
:widths: 20 80 | ||
|
||
* - :doc:`CECM <../CECM>` | ||
- calculating speed, flow and density when analysing pedestrian trajectories at a measurement line. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: mention here, that this a Continuity Equation conform way
@schroedtert I think I fixed all stuff regarding your review. |
This PR implements the paper
Adrian et al, 2024, Continuity equation and fundamental diagram of pedestrians