From ba33600970f81f49499c4c4fce0bd8162596787b Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Mon, 8 Sep 2025 13:02:48 +0000 Subject: [PATCH] Remove FOLLOW_ARRIVALS table in favor of the EVENTS model Comment out some other tables, until the ARRIVALS table exists and needs them. Rename the constant which identifies an arriving individual with certainty. --- doc/src/code_tables.m4 | 134 +++++++++---------- doc/src/epilog.inc.m4 | 45 ++----- doc/src/tables.m4 | 1 - doc/src/tables/follow_arrivals.m4 | 211 ------------------------------ doc/src/tables/follows.m4 | 15 ++- include/global_constants.m4 | 2 +- 6 files changed, 87 insertions(+), 321 deletions(-) delete mode 100644 doc/src/tables/follow_arrivals.m4 diff --git a/doc/src/code_tables.m4 b/doc/src/code_tables.m4 index e8640cb..3705ac8 100644 --- a/doc/src/code_tables.m4 +++ b/doc/src/code_tables.m4 @@ -141,45 +141,46 @@ Description |COMM_MEMBS_SOURCES.Description_summary| |emptytext| -.. _DATA_SOURCES: +.. Comment out until ARRIVALS exists + .. _DATA_SOURCES: -DATA_SOURCES (Sources of follow arrival Data) ---------------------------------------------- + DATA_SOURCES (Sources of follow arrival Data) + --------------------------------------------- -.. |DATA_SOURCES_summary| replace:: - Contains one row for each source of data for |FOLLOW_ARRIVALS| rows. + .. |DATA_SOURCES_summary| replace:: + Contains one row for each source of data for |ARRIVALS| rows. -|DATA_SOURCES_summary| + |DATA_SOURCES_summary| -Special Values -`````````````` -None. + Special Values + `````````````` + None. -Column Descriptions -``````````````````` + Column Descriptions + ``````````````````` -.. _DATA_SOURCES.Source: + .. _DATA_SOURCES.Source: -Source -'''''' + Source + '''''' -.. |DATA_SOURCES.Source_summary| replace:: - A code identifying a source of |FOLLOW_ARRIVALS| data. + .. |DATA_SOURCES.Source_summary| replace:: + A code identifying a source of |FOLLOW_ARRIVALS| data. -|DATA_SOURCES.Source_summary| |keycol| + |DATA_SOURCES.Source_summary| |keycol| -.. _DATA_SOURCES.Description: + .. _DATA_SOURCES.Description: -Description -''''''''''' + Description + ''''''''''' -.. |DATA_SOURCES.Description_summary| replace:: - A description of the code. + .. |DATA_SOURCES.Description_summary| replace:: + A description of the code. -|DATA_SOURCES.Description_summary| |emptytext| + |DATA_SOURCES.Description_summary| |emptytext| .. _DEPARTTYPES: @@ -270,6 +271,49 @@ Description |ENTRYTYPES.Description_summary| |emptytext| |notnull| +.. _CERTAINTIES: + +CERTAINTIES +----------- + +.. |CERTAINTIES_summary| replace:: + Contains one row for for each code designating the certainity of + an event. + +|CERTAINTIES_summary| + + +Special Values +`````````````` +The value ``sdb_identity_certain`` indicates that the observer(s) +are certain of the identity of an arriving individual. + + +Column Descriptions +``````````````````` + +.. _CERTAINTIES.Certainty: + +Certainty +''''''''' + +.. |CERTAINTIES.Certainty_summary| replace:: + A one character code designating a certainty assessment. + +|CERTAINTIES.Certainty_summary| |keycol| |uppercase| + + +.. _CERTAINTIES.Description: + +Description +''''''''''' + +.. |CERTAINTIES.Description_summary| replace:: + A description of the certainty code. + +|CERTAINTIES.Description_summary| |emptytext| + + .. _CYCLE_STATES: CYCLE_STATES @@ -319,50 +363,6 @@ Description |CYCLE_STATES.Description_summary| |emptytext| -.. _FA_CERTAINTIES: - -FA_CERTAINTIES (Follow Arrival Certainties) -------------------------------------------- - -.. |FA_CERTAINTIES_summary| replace:: - Contains one for for each code designating the certainity of the - identification of the individual under observation (the - |FOLLOW_ARRIVALS|.\ |FOLLOW_ARRIVALS.AnimID|). - -|FA_CERTAINTIES_summary| - - -Special Values -`````````````` -The value ``sdb_fa_identity_certain`` indicates that the observer(s) -are certain of the identity of an arriving individual. - - -Column Descriptions -``````````````````` - -.. _FA_CERTAINTIES.Certainty: - -Certainty -''''''''' - -.. |FA_CERTAINTIES.Certainty_summary| replace:: - A one character code designating a certainty assessment. - -|FA_CERTAINTIES.Certainty_summary| |keycol| |uppercase| - - -.. _FA_CERTAINTIES.Description: - -Description -''''''''''' - -.. |FA_CERTAINTIES.Description_summary| replace:: - A description of the certainty code. - -|FA_CERTAINTIES.Description_summary| |emptytext| - - .. _OBS_PERIODS: OBS_PERIODS (Obsevervation Periods) diff --git a/doc/src/epilog.inc.m4 b/doc/src/epilog.inc.m4 index ecf4044..0ffa6a1 100644 --- a/doc/src/epilog.inc.m4 +++ b/doc/src/epilog.inc.m4 @@ -150,11 +150,12 @@ sdb_generated_rst()dnl .. |COMM_MEMBS_SOURCES.Description| replace:: :ref:`Description ` -.. |DATA_SOURCES| replace:: :ref:`DATA_SOURCES ` -.. |DATA_SOURCES.Source| replace:: - :ref:`Source ` -.. |DATA_SOURCES.Description| replace:: - :ref:`Description ` +.. Comment out until ARRIVALS exists + .. |DATA_SOURCES| replace:: :ref:`DATA_SOURCES ` + .. |DATA_SOURCES.Source| replace:: + :ref:`Source ` + .. |DATA_SOURCES.Description| replace:: + :ref:`Description ` .. |DEPARTTYPES| replace:: :ref:`DEPARTTYPES ` .. |DEPARTTYPES.DepartType| replace:: @@ -172,11 +173,11 @@ sdb_generated_rst()dnl .. |CYCLE_STATES.Description| replace:: :ref:`Description ` -.. |FA_CERTAINTIES| replace:: :ref:`FA_CERTAINTIES ` -.. |FA_CERTAINTIES.Certainty| replace:: - :ref:`Certainty ` -.. |FA_CERTAINTIES.Description| replace:: - :ref:`Description ` +.. |CERTAINTIES| replace:: :ref:`CERTAINTIES ` +.. |CERTAINTIES.Certainty| replace:: + :ref:`Certainty ` +.. |CERTAINTIES.Description| replace:: + :ref:`Description ` .. |FOLLOWS| replace:: :ref:`FOLLOWS ` .. |FOLLOWS.FID| replace:: @@ -190,30 +191,6 @@ sdb_generated_rst()dnl .. |FOLLOWS.Date| replace:: :ref:`Date ` -.. |FOLLOW_ARRIVALS| replace:: :ref:`FOLLOW_ARRIVALS ` -.. |FOLLOW_ARRIVALS.FAID| replace:: - :ref:`FAID ` -.. |FOLLOW_ARRIVALS.FID| replace:: - :ref:`FID ` -.. |FOLLOW_ARRIVALS.AnimID| replace:: - :ref:`AnimID ` -.. |FOLLOW_ARRIVALS.Seq| replace:: - :ref:`Seq ` -.. |FOLLOW_ARRIVALS.Start| replace:: - :ref:`Start ` -.. |FOLLOW_ARRIVALS.End| replace:: - :ref:`End ` -.. |FOLLOW_ARRIVALS.Certainty| replace:: - :ref:`Certainty ` -.. |FOLLOW_ARRIVALS.NestStart| replace:: - :ref:`NestStart ` -.. |FOLLOW_ARRIVALS.NestEnd| replace:: - :ref:`NestEnd ` -.. |FOLLOW_ARRIVALS.Cycle| replace:: - :ref:`Cycle ` -.. |FOLLOW_ARRIVALS.DataSource| replace:: - :ref:`DataSource ` - .. |FOLLOW_OBSERVERS| replace:: :ref:`FOLLOW_OBSERVERS ` .. |FOLLOW_OBSERVERS.FOID| replace:: :ref:`FOID ` diff --git a/doc/src/tables.m4 b/doc/src/tables.m4 index 4474ea3..da737da 100644 --- a/doc/src/tables.m4 +++ b/doc/src/tables.m4 @@ -33,6 +33,5 @@ Data Tables tables/comm_membs.rst tables/comm_memb_log.rst tables/follows.rst - tables/follow_arrivals.rst tables/follow_observers.rst tables/follow_studies.rst diff --git a/doc/src/tables/follow_arrivals.m4 b/doc/src/tables/follow_arrivals.m4 deleted file mode 100644 index 6cf35da..0000000 --- a/doc/src/tables/follow_arrivals.m4 +++ /dev/null @@ -1,211 +0,0 @@ -.. Copyright (C) 2024 The Meme Factory, Inc. www.karlpinc.com - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -.. M4 setup -include(constants.m4)dnl -include(macros.m4)dnl -sdb_rst_quotes(`on')dnl -sdb_generated_rst()dnl - -.. _FOLLOW_ARRIVALS: - -FOLLOW_ARRIVALS ----------------- - -.. |FOLLOW_ARRIVALS_summary| replace:: - Each row represents a period of time during which an individual is - under observation in the follow. - -|FOLLOW_ARRIVALS_summary| The system will generate a warning when -there is no row for the follow's focal (|FOLLOWS|.\ |FOLLOWS.Focal|) -in FOLLOW_ARRIVALS. -When an individual can no longer be observed and after a period of -time is again observed, a situation which may occur multiple times, -there is a FOLLOW_ARRIVALS row for each time period during which an -individual is under observation. - -The |FOLLOW_ARRIVALS.Start| time cannot be after the -|FOLLOW_ARRIVALS.End| time. -The system will generate a warning when |FOLLOW_ARRIVALS.Start| is -equal to |FOLLOW_ARRIVALS.End|. - -When there is more than one FOLLOW_ARRIVALS row for a given individual -(for a given |FOLLOW_ARRIVALS.AnimID|), for a given follow (for a -given FOLLOW_ARRIVALS.\ |FOLLOW_ARRIVALS.FID|), and either of the -row's FOLLOW_ARRIVALS.\ |FOLLOW_ARRIVALS.Certainty| value is -``sdb_fa_identity_certain``, then the |FOLLOW_ARRIVALS.Start| and -|FOLLOW_ARRIVALS.End| values cannot overlap, endpoints included. -The system will generate a warning when there is more than one -FOLLOW_ARRIVALS row for a given individual, for a given follow, and -the |FOLLOW_ARRIVALS.Start| of one row overlaps, endpoints -included, with the |FOLLOW_ARRIVALS.End| of the other row. - -The ``sdb_male_swelling`` |CYCLE_STATES|.\ |CYCLE_STATES.Code| is -the only value that can be used in the |FOLLOW_ARRIVALS.Cycle| column -when the |FOLLOW_ARRIVALS.AnimID| identifies a non-female; the only -value that can be used when the related |BIOGRAPHY_DATA|.\ -|BIOGRAPHY_DATA.Sex| column is either ``sdb_male`` or ``sdb_unk_sex``, -the unknown sex. - -The ``sdb_adolescent_swelling`` |CYCLE_STATES|.\ -|CYCLE_STATES.Code| can only be used in the |FOLLOW_ARRIVALS.Cycle| -column when the |FOLLOW_ARRIVALS.AnimID| identifies an adolescent -female, can only be used when the related |BIOGRAPHY_DATA|.\ -|BIOGRAPHY_DATA.Sex| column is ``sdb_female`` and the individual's age -on the |FOLLOWS|.\ |FOLLOWS.Date| is at least sdb_min_adolescent_age -sdb_min_adolescent_age_units old and not more than -sdb_max_adolescent_age sdb_max_adolescent_age_units old. - - -.. _FOLLOW_ARRIVALS.FAID: - -FAID (Follow Arrivals ID) -````````````````````````` - -.. |FOLLOW_ARRIVALS.FAID_summary| replace:: - |idcol| - -|FOLLOW_ARRIVALS.FAID_summary| |notnull| - - -.. _FOLLOW_ARRIVALS.FID: - -FID (Follow IDentifier) -``````````````````````` - -.. |FOLLOW_ARRIVALS.FID_summary| replace:: - The |FOLLOWS|.\ |FOLLOWS.FID| that identifies the follow during - which the individual identified by the |FOLLOW_ARRIVALS.AnimID| was - under observation. - -|FOLLOW_ARRIVALS.FID_summary| |notnull| - - -.. _FOLLOW_ARRIVALS.AnimID: - -AnimID (Animal ID) -`````````````````` - -.. |FOLLOW_ARRIVALS.AnimID_summary| replace:: - The |BIOGRAPHY_DATA|.\ |BIOGRAPHY_DATA.AnimID| identifying the - individual, focal or non-focal, who was under observation during - the follow. - -|FOLLOW_ARRIVALS.AnimID_summary| |notnull| - - -.. _FOLLOW_ARRIVALS.Seq: - -Seq (Sequence Number) -````````````````````` - -.. |FOLLOW_ARRIVALS.Seq_summary| replace:: - An automatically generated integer, starting with 1 and increasing - by one without gaps, which indicates the timewise ordering of a - given individual's presence, a given |FOLLOW_ARRIVALS.AnimID|'s - presence, in the follow. - -|FOLLOW_ARRIVALS.Seq_summary| So, the Seq increments each time an -individual (re)joins the follow. -|cannot_change| |notnull| - - -.. _FOLLOW_ARRIVALS.Start: - -Start -````` - -.. |FOLLOW_ARRIVALS.Start_summary| replace:: - The time the individual was first observed, in the given contiguous time - period during which they were considered present in the follow. - -|FOLLOW_ARRIVALS.Start_summary| |noseconds| |notnull| - - -.. _FOLLOW_ARRIVALS.End: - -End -``` - -.. |FOLLOW_ARRIVALS.End_summary| replace:: - The time the individual was last observed, in the given contiguous time - period during which they were considered present in the follow. - -|FOLLOW_ARRIVALS.End_summary| |noseconds| |notnull| - - -.. _FOLLOW_ARRIVALS.Certainty: - -Certainty -````````` - -.. |FOLLOW_ARRIVALS.Certainty_summary| replace:: - A |FA_CERTAINTIES|.\ |FA_CERTAINTIES.Certainty| code designating the - certainty of the identification of the individual; the certainty - of the |FOLLOW_ARRIVALS.AnimID| value. - -|FOLLOW_ARRIVALS.Certainty_summary| |notnull| - - -.. _FOLLOW_ARRIVALS.NestStart: - -NestStart -````````` - -.. |FOLLOW_ARRIVALS.NestStart_summary| replace:: - Whether the individual was first observed in a nest. - An integer, either ``sdb_in_nest`` when the individual was first - observed in a nest, or ``sdb_out_of_nest`` when the individual was - not first observed in a nest. - -|FOLLOW_ARRIVALS.NestStart_summary| |notnull| - - -.. _FOLLOW_ARRIVALS.NestEnd: - -NestEnd -``````` - -.. |FOLLOW_ARRIVALS.NestEnd_summary| replace:: - Whether the individual was last observed in a nest. - An integer, either ``sdb_in_nest`` when the individual was first - observed in a nest, or ``sdb_out_of_nest`` when the individual was - not first observed in a nest. - -|FOLLOW_ARRIVALS.NestEnd_summary| |notnull| - - -.. _FOLLOW_ARRIVALS.Cycle: - -Cycle -````` - -.. |FOLLOW_ARRIVALS.Cycle_summary| replace:: - A code indicating the estrous state of the individual; a - |CYCLE_STATES|.\ |CYCLE_STATES.Code| value. - -|FOLLOW_ARRIVALS.Cycle_summary| |notnull| - - -.. _FOLLOW_ARRIVALS.DataSource: - -DataSource -`````````` - -.. |FOLLOW_ARRIVALS.DataSource_summary| replace:: - Code indicating the source of the row's data; a |DATA_SOURCES|.\ - |DATA_SOURCES.Source| value. - -|FOLLOW_ARRIVALS.DataSource_summary| |notnull| diff --git a/doc/src/tables/follows.m4 b/doc/src/tables/follows.m4 index b35d7bf..d65140b 100644 --- a/doc/src/tables/follows.m4 +++ b/doc/src/tables/follows.m4 @@ -29,13 +29,14 @@ FOLLOWS to follow a focal individual. |FOLLOWS_summary| A scheduled follow may or may not have any related -observations, related |FOLLOW_ARRIVALS| rows. - -The system will generate a warning when a FOLLOWS row does not have a -|FOLLOW_ARRIVALS| related row that records the presence of the focal, -does not have a related |FOLLOW_ARRIVALS| row where the -|FOLLOW_ARRIVALS|.\ |FOLLOW_ARRIVALS.AnimID| has the same value as the -follow's |FOLLOWS.Focal| column. +observations, related |EVENTS| rows. + +.. Comment out until ARRIVALS exists + The system will generate a warning when a FOLLOWS row does not have a + |ARRIVALS| related row that records the presence of the focal, + does not have a related |EVENTS| row with a related |ARRIVALS| row where the + |ARRIVALS|.\ |ARRIVALS.AnimID| has the same value as the + follow's |FOLLOWS.Focal| column. A scheduled follow must have at least one related |FOLLOW_OBSERVERS| rows, to record the observers scheduled to conduct the follow. diff --git a/include/global_constants.m4 b/include/global_constants.m4 index d78ebd9..69a7957 100644 --- a/include/global_constants.m4 +++ b/include/global_constants.m4 @@ -103,7 +103,7 @@ define(`sdb_adolescent_swelling', `U') dnl dnl The Certainty value for when certain of the identity of an arriving dnl individual. -define(`sdb_fa_identity_certain', `1') +define(`sdb_identity_certain', `1') divert(`0')dnl Output with m4 again ]}])dnl End of ifdef over the whole file. -- 2.34.1