Skip to content

Commit

Permalink
fix minor documentation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
LoannPeurey committed Feb 27, 2024
1 parent 9c2c79a commit c61e4b7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 22 deletions.
2 changes: 1 addition & 1 deletion ChildProject/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class AnnotationManager:
),
IndexColumn(
name="annotation_filename",
description="output formatted annotation location, relative to `annotations/<set>/converted (automatic column, don't specify)",
description="output formatted annotation location, relative to `annotations/<set>/converted` (automatic column, don't specify)",
filename=True,
required=False,
generated=True,
Expand Down
4 changes: 2 additions & 2 deletions ChildProject/pipelines/metricsFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def new_func(annotations: pd.DataFrame, duration: int, **kwargs):
return np.nan

# wraps will give the same name and doc, so we need to slightly edit them for the peak function
new_func.__doc__ = "Computing the peak for 1h for the following metric:\n" + function.__doc__
new_func.__doc__ = "Computing the peak for 1h for the following metric:\n\n" + function.__doc__
new_func.__name__ = "peak_" + function.__name__
new_func.__qualname__ = "peak_" + function.__qualname__
return new_func
Expand All @@ -160,7 +160,7 @@ def new_func(annotations: pd.DataFrame, duration: int, **kwargs):
return function(annotations, duration, **kwargs) * (3600000 / duration)

# wraps will give the same name and doc, so we need to slightly edit them for the peak function
new_func.__doc__ = function.__doc__ + "This value is a 'per hour' value."
new_func.__doc__ = function.__doc__ + "\nThis value is a 'per hour' value."
new_func.__name__ = function.__name__ + '_ph'
new_func.__qualname__ = function.__qualname__ + '_ph'
return new_func
Expand Down
17 changes: 8 additions & 9 deletions ChildProject/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,18 +203,17 @@ def calculate_shift(file1, file2, start1, start2, interval):
return res,len(ref)

def find_lines_involved_in_overlap(df: pd.DataFrame, onset_label: str = 'range_onset', offset_label:str = 'range_offset', labels = []):
"""
takes a dataframe as input. The dataframe is supposed to have a column for the onset
"""takes a dataframe as input. The dataframe is supposed to have a column for the onset
og a timeline and one for the offset. The function returns a boolean series where
all indexes having 'True' are lines involved in overlaps and 'False' when not
e.g. to select all lines involved in overlaps, use:
```
ovl_segments = df[find_lines_involved_in_overlap(df, 'segment_onset', 'segment_offset')]
```
and to select line that never overlap, use:
```
ovl_segments = df[~find_lines_involved_in_overlap(df, 'segment_onset', 'segment_offset')]
```
```
ovl_segments = df[find_lines_involved_in_overlap(df, 'segment_onset', 'segment_offset')]
```
and to select line that never overlap, use:
```
ovl_segments = df[~find_lines_involved_in_overlap(df, 'segment_onset', 'segment_offset')]
```
:param df: pandas DataFrame where we want to find overlaps, having some time segments described by 2 columns (onset and offset)
:type df: pd.DataFrame
Expand Down
3 changes: 1 addition & 2 deletions docs/source/ChildProject.pipelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ChildProject.pipelines.eafbuilder module
:show-inheritance:

ChildProject.pipelines.metrics module
--------------------------------------
-------------------------------------

.. automodule:: ChildProject.pipelines.metrics
:members:
Expand Down Expand Up @@ -51,7 +51,6 @@ ChildProject.pipelines.processors module
:members:
:undoc-members:
:show-inheritance:


ChildProject.pipelines.samplers module
--------------------------------------
Expand Down
10 changes: 2 additions & 8 deletions docs/source/format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ in a separate file.
For recursive metadata, two dataframes cannot share the same basename.
For instance, if one dataframe is located at `metadata/children/dates-of-birth.csv` ,
an error will be thrown if another dataframe exists at
`metadata/children/private/dates-of-birth.csv ` .
`metadata/children/private/dates-of-birth.csv` .

Annotations
-----------
Expand Down Expand Up @@ -200,9 +200,6 @@ These humans have both annotated the same seven 15 second clips.
eaf_2021/LM,A730/A730_001105.wav,0,36465000,36480000,A730_001105.eaf,eaf,A730/A730_001105_36465000_36480000.csv
eaf_2021/LM,A730/A730_001105.wav,0,39450000,39465000,A730_001105.eaf,eaf,A730/A730_001105_39450000_39465000.csv

.. comment::
This comment fixes an issue introduced in Sphinx 4.3.1

.. _format-input-annotations:

Annotation importation input format
Expand Down Expand Up @@ -246,15 +243,12 @@ to the following table:
.. index-table:: Machine-readable documentation
:header: documentation

.. comment::
This comment fixes an issue introduced in Sphinx 4.3.1

- Documentation for the children metadata should be stored in ``docs/children.csv``
- Documentation for the recordings metadata should be stored in ``docs/recordings.csv``
- Documentation for annotations should be stored in ``docs/annotations.csv``

Authorship
~~~~~~~~~~

We recommend DataCite's .yaml format (see `here <https://github.com/G-Node/gogs/blob/master/conf/datacite/datacite.yml>`_)
We recommend DataCite's .yaml format (see `here <https://github.com/G-Node/gogs/blob/master/conf/datacite/datacite.yml>`__)

0 comments on commit c61e4b7

Please sign in to comment.