AncestorFill report addon division by zero error?

Just had a quick diversion down a wiki updating rabbit hole for the Reports section. (Technically, Add-ons don’t belong in the the core documentation. But since they ARE there to compensate for a flaw in the Report help button linking, it makes sense for cross-references to have usable links.)

But hit a snag with the AncestorFill Report. There is no wiki page [added Addon:Ancestor Fill Report] (nor README.md in its GitHub source folder) for the AncestorFill report. And running the Report gives a Division by zero error on my Fedora system with the example.gramps sample tree. So I don’t even know what the report does.

Does this report error on Windows, macOS and other Linux installations?


344314: ERROR: _reportdialog.py: line 748: Failed to run report.
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/gramps/gui/plug/report/_reportdialog.py", line 709, in report
    my_report.write_report()
  File "/home/districtsupport/.gramps/gramps51/plugins/AncestorFill/AncestorFill.py", line 253, in write_report
    timplexe= ( total - totalnbanc) * 100.0 / total
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
ZeroDivisionError: float division by zero

@emyoulation It seems to happen when a person has no ancestors. Strange no one found that bug before. I write a bugfix for it.

2 Likes

The report finds how complete each generation is and if there is any pedigree collapse.

Here is a sample output.

1 Like

@emyoulation While testing my changes I also found another error. :smile:

2 Likes

Thank you!

Could you please increment the version in the .gpr.py registration file too?

This is really odd. [Cause: He had custom relationships to the parents, not ‘Birth’]

That Person HAD ancestors. Here is the Pedigree gramplet content:

Even with the patch, the AncestorFill reports wrongly:

   AncestorFill for GARNER VON ZIELIŃSKI, Lewis Anderson (Big Louie)

Generation 0
Number of Ancestors found 1
percent of Ancestors found 100.0000000000%
Number of single Ancestors found 1
Pedigree Collapse 0.0000000000%

Total Number of Ancestors found 0
Total Number of single Ancestors found 0
Pedigree Collapse 0.0000000000%

And the '“Theoretical”

   AncestorFill for GARNER VON ZIELIŃSKI, Lewis Anderson (Big Louie)

Total Number of Ancestors found 0
Total Number of single Ancestors found 0
Pedigree Collapse 0.000%

After testing, as best as I can tell, at least one of the parents in the relationship to the child must be by Birth. The other parent is counted as Theoretical when the option is checked, ignored when unchecked.

Done.

Yes only parent-child birth relationships are counted.

Yes that could be one reason, but there is also another:
The report has two parts:

  1. Generation statistics => contains theoretical number of ancestors per generation
  2. Total statistics (all generations) => does not contain a theoretical number
    => if (1) is not generated (no “birth” parents), then there is no theoretical number in the report

@emyoulation Please test the patch and let me know if something else does not work as expected.

1 Like

The new minor changes (capitalization and defaults) are nice. But do the following tweaks improve things?
Note for other testers: to see the changed defaults, flush the AncestorFill module section from .gramps/report_options.xml

  1. If Generations count default was ‘5’ instead of ‘10’ then the report generates a single page by default. Since there are no footers or repeated headers, a single page is a better default.

  2. Doubling the rounding precision (decimal places) for “Collapsed digit” from ‘2’ to ‘4’ makes Pedigree Collapse percentage more distinct from “Filled digit”. So it is more apparent where each parameter is applied in the report.

  3. For
    “Number of single Ancestors found 17”
    The “single” is unclear. It PROBABLY actually means “unique”
    “Number of unique Ancestors found 17”

  4. And for the other one that currently reads:
    “Number of Ancestors found 17”
    This conversation shows that the “birth” distinction is important. So it would read better as:
    “Number of birth Ancestors found 17”

Now that I’ve seen the report, an addon page is going to have to be built… so a lot more exploring. The next steps will include verifying that the percentiles conform to standard calculations.

  1. Done
  2. There are already tooltips for the option parameters which should be useful. Not sure if that change would really help or just confuse.
  3. Done
  4. Does “birth Ancestors” make sense? Maybe “Number of (biological) Ancestors found xx”?

The calculation is just (total_ancestors - total_unique) * 100 / total_ancestors, so it does not calculate the genetic distance of the relationship. (Note: It should not matter though, because if you have a close collapse you have more duplicate ancestors than when you have a distant collapse)

1 Like

I mulled over the same idea before posting. And regretfully fell back to suggesting ‘birth’. Another term might be more accurate. But then the user starts searching for a “biological” setting to get the report to work. Yet the Gramps GUI only has “birth” values in its affinity relationships. So I chose to follow the term in the database.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.