Skip to content

Commit f038a28

Browse files
committed
docs: document year=-1/month=-1 sentinel values for lab cross samples
Closes #1092 Add a notes section to the sample_metadata() @doc decorator explaining that some samples are lab crosses (mosquitoes bred in the laboratory) that use year=-1 and month=-1 as sentinel values for 'no collection date'. Include an example showing how to filter them out using sample_query. This is a documentation-only change — no runtime behavior is modified.
1 parent c269768 commit f038a28

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

malariagen_data/anoph/sample_metadata.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,17 @@ def clear_extra_metadata(self):
702702
@doc(
703703
summary="Access sample metadata for one or more sample sets.",
704704
returns="A dataframe of sample metadata, one row per sample.",
705+
notes="""
706+
Some samples in the dataset are lab crosses — mosquitoes bred in
707+
the laboratory that have no real collection date. These samples
708+
use ``year=-1`` and ``month=-1`` as sentinel values. They may
709+
cause unexpected results in date-based analyses (e.g.,
710+
``pd.to_datetime`` will fail on negative year values).
711+
712+
To exclude lab cross samples, use::
713+
714+
df = api.sample_metadata(sample_query="year >= 0")
715+
""",
705716
)
706717
def sample_metadata(
707718
self,

0 commit comments

Comments
 (0)