Post by Uncle Buddy on Mar 19, 2023 5:11:04 GMT -8
RELATIONSHIP CALCULATOR
to be written in Python and Web2Py?
www.familysearch.org/en/blog/cousin-chart
In a tree with 26 people there are 325 possible relationship pairs (order doesn't matter; AB = BA). (25 + 24 + 23 etc.)
My wife was in the hospital for four days so instead of taking my computer with me to the hospital room, I printed out some of the open-source Gramps project's information on relationship calculations and glanced at it from time to time when I needed help going to sleep. Maybe I learned something and maybe I didn't. I'm in the very first stages of trying to figure this out and it might have helped to have something to look at instead of the void of my mind.
My hypothetical calculator so far ignores gender, whether parents are biological parents, and customs such as marriage, divorce, and adoption. It just notes whether people are in the same family in some way that can be described as simply as possible. So an aunt and an uncle have the same value; a spouse and a common-law-spouse and an ex-spouse have the same value; a foster child and a child and a step-child have the same value; a brother and a step-sister have the same value. We don't see the point in having a relationship calculator duplicate everything we can look up in the tree (e.g. a couple was divorced or a child was adopted.) The real purpose of this calculator is to count distance in generations between two persons, summarize, and make generalizations, not to count the freckles on the tip of 16th Cousin Becky's nose. This calculator should detect pairings of two people where the two people have more than one relationship, up to but not including, "I'm my own grampaw". The creator of this calculator accepts no responsibility for putting out silly long-winded expressions like "partner's sibling's child-in-law's partner's parent-in-law". That's what we get for marrying people from the same planet.
To design a coding strategy for this calculator, we (that's a fancy word for "me") are trying to imagine what we must have to do when we look at a visual tree like the one below, in order to determine that D is H's parent-in-law. Apparently it's gonna be a matter of starting from one of the two persons in question, tracing through connected persons one step at a time while naming each step and compiling a chain of relationship names or codes, and when you get to the second person, read the chain and translate it into a useful form. If you want to know about second or secondary relationships between two persons, trace again but this time go a different way. If you want to know everything, trace every possible way, and each time you arrive at the second person, append the chain of single-step-namings to a list of relationships.
Based on the arrangement of the chart below, there are horizontal relationships (partners) and vertical relationships (parent/child). Horizontal pairings are left or right, it doesn't matter, but vertical has to be subdivided into UP or DOWN. You go UP to get your parent or DOWN to get your child. So P1's child is D for down and P1's grandchild is DD for down twice. Siblings have no line between them in the chart so you have to go UP once and DOWN once, so a sibling relationship is UD. A first cousin is UP to parent, UP to grandparent, then DOWN to uncle/aunt and DOWN again to cousin. So cousin is UUDD. Second cousin is UUUDDD. A generation removed will look like this, for example: UUUDD or UUDDD. The most basic relationships are one letter: parent is U, child is D, and partner is O for OVER (lateral or horizontal connection on the chart).
To me the most interesting part is that your sibling is really your zeroeth cousin. I find that fascinating.
to be written in Python and Web2Py?
www.familysearch.org/en/blog/cousin-chart
In a tree with 26 people there are 325 possible relationship pairs (order doesn't matter; AB = BA). (25 + 24 + 23 etc.)
My wife was in the hospital for four days so instead of taking my computer with me to the hospital room, I printed out some of the open-source Gramps project's information on relationship calculations and glanced at it from time to time when I needed help going to sleep. Maybe I learned something and maybe I didn't. I'm in the very first stages of trying to figure this out and it might have helped to have something to look at instead of the void of my mind.
My hypothetical calculator so far ignores gender, whether parents are biological parents, and customs such as marriage, divorce, and adoption. It just notes whether people are in the same family in some way that can be described as simply as possible. So an aunt and an uncle have the same value; a spouse and a common-law-spouse and an ex-spouse have the same value; a foster child and a child and a step-child have the same value; a brother and a step-sister have the same value. We don't see the point in having a relationship calculator duplicate everything we can look up in the tree (e.g. a couple was divorced or a child was adopted.) The real purpose of this calculator is to count distance in generations between two persons, summarize, and make generalizations, not to count the freckles on the tip of 16th Cousin Becky's nose. This calculator should detect pairings of two people where the two people have more than one relationship, up to but not including, "I'm my own grampaw". The creator of this calculator accepts no responsibility for putting out silly long-winded expressions like "partner's sibling's child-in-law's partner's parent-in-law". That's what we get for marrying people from the same planet.
To design a coding strategy for this calculator, we (that's a fancy word for "me") are trying to imagine what we must have to do when we look at a visual tree like the one below, in order to determine that D is H's parent-in-law. Apparently it's gonna be a matter of starting from one of the two persons in question, tracing through connected persons one step at a time while naming each step and compiling a chain of relationship names or codes, and when you get to the second person, read the chain and translate it into a useful form. If you want to know about second or secondary relationships between two persons, trace again but this time go a different way. If you want to know everything, trace every possible way, and each time you arrive at the second person, append the chain of single-step-namings to a list of relationships.
Based on the arrangement of the chart below, there are horizontal relationships (partners) and vertical relationships (parent/child). Horizontal pairings are left or right, it doesn't matter, but vertical has to be subdivided into UP or DOWN. You go UP to get your parent or DOWN to get your child. So P1's child is D for down and P1's grandchild is DD for down twice. Siblings have no line between them in the chart so you have to go UP once and DOWN once, so a sibling relationship is UD. A first cousin is UP to parent, UP to grandparent, then DOWN to uncle/aunt and DOWN again to cousin. So cousin is UUDD. Second cousin is UUUDDD. A generation removed will look like this, for example: UUUDD or UUDDD. The most basic relationships are one letter: parent is U, child is D, and partner is O for OVER (lateral or horizontal connection on the chart).
To me the most interesting part is that your sibling is really your zeroeth cousin. I find that fascinating.
X
|
Y = Z
__________________|__________________________
| |
A = B C = D = T = V
______|__________ __________|___ |__________
| | | | | | | |
L = E F G H = I J U W |
__|______________ ______________________|______ |
| | | | | | | |
M N O = P Q R S=======================K
P1 P2 UP/DOWN/OVER P2'S REL. TO P1 DETAIL
_________________________________________________________________________________
A B O partner
A C OUDO sibling-in-law partner's sibling's partner
A D OUD sibling-in-law partner's sibling
B K UDOD none sibling's partner's child
B K DDOUDO none g-child's partner's sibling's partner
A E/F/G D child
A F D child
A G D child
A H OUDDS none partner's sibling's child-in-law
D B UD sibling
U F UUDD 1st cousin
P O O partner
P O UUUDDD 2nd cousin
P Z UUU g-g-child
O Z UUU g-g-child
J C U parent
R U UUD uncle/aunt
J M UUDDD 1st cuz once rem. first cousin's child
O I UUUDD 1st cus once rem. 2nd cousin's parent