-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix error in Fast*Filter #1834
Fix error in Fast*Filter #1834
Conversation
@dsblank do you want to review this one? I'm not sure how we can identify similar problems. A brute force search perhaps "value[[0-9]+]"? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
That's exactly what I meant here #1828 (comment)
Yes, type hints would help, since if But the problem is that type hints cannot tell which primary object type the In fact, in my opinion adding type hints throughout the code (which I have volunteered to do but is blocked by #1717 not being merged) would have the benefit of identifying such cases (and I'm sure there are more lurking in other functions). |
I think I missed this one because it used
I am a big fan of type hints, and used them throughout the filter refactor for the database and arguments to apply_to_one. This set of changes is harder because:
I think for now, just visual inspection and testing by running the code will help find these. I think it is mostly in the editors that we need to triple check. |
Actually, like the name implies, |
Great. My background is primarily statically typed languages so I personally like the safety net that static type checking provides.. Conceptually at least a PersonDataDict, EventDataDict etc. would take care of that |
I've updated the PR to change the variable name to |
suggests that the are uses in |
Yes, but if it's typed as
Yes. |
On the flipside, any external code that uses and then code external to gramps-project |
As soon as we make the Gramps 6.0 branch for addons, I'll go through those. |
|
@Nick-Hall, what's the policy on merging small bug-fixes like this one? Is there a minimum amount of time that needs to pass? BTW, I still have merge rights. I'd be glad to help with these small PR fixes by reviewing and merging. |
Since an "Other" gender was recently added, may I ask if a FastOtherFilter class should exist? |
That's a good question. We have a bunch of related issues:
On another level, I'm note sure we should even use these Fast*Filters. They drop down to the raw level, by bypassing any proxy. If a proxy hid the gender, this code breaks that barrier. The use of raw data should be thoroughly examined in the codebase. |
Won't the Fast*Filters respect whatever is returned by the db they are passed? |
Oh, wow! I completely missed that. Of course it is slower than molasses, but it would work. It does bother me that it isn't easy to see all of these costs building up. This function will get the raw data, turn it into an object, sanitize it, and then turn it back into raw data. [I wonder how fast it is having to do all of that in a proxy] |
The current policy is that bug fixes should remain open for at least 1 week before merging. Enhancements should remain open for at least three weeks to give time for all developers to comment. Sometimes people can be travelling or have limited internet access for other reasons.
Thanks for volunteering. The workflow that I have used in the past is to add the "Approved" label to a PR when it is ready for further review and testing. It indicates that I have no fundamental objections to the PR, but haven't had time to look at it in detail yet. I'll start going through the open PRs and adding these labels tomorrow. |
In the family editor, father is male and mother is female. These will list the most likely results. There is always the "All" checkbox to select from everyone. This is useful for same sex relationships and also to select a person who is not recorded as male or female.
Generally "spouse" is going to be preferable to "husband" or "wife" and "parent" preferable to "father" or "mother". However, the family editor is used for families that may or may not have children and the partners may or may not be of the same sex. Do we need these headings in the family editor? |
Maybe. Partner gets used a lot, especially but not exclusively with LGBTQ+ families. I know quite a few marriages with two husbands or two wives.
That gets a bit tricky when dealing with Y and Mt DNA. For the foreseeable future everybody gets one biological father and one biological mother, and that's the family that most—even LGBTQ+—genealogists want to trace.
The current headings in the Family Editor are How about letting the user choose what the family members are titled? |
I like when the user can choose. The Family object editor looks a bit "unfinished" with the current "Father/partner1" and "Mother/partner2" labels. The use of "Spouse" would be a misnomer when the Family's Type is "Unknown" or "Unmarried" |
a couple of points:
|
Agreed. (This is an instance where it would be nice to enable github "Issue Tracker" so we can easily reference these conversations and side issues) |
Yes. Please create a separate PR for the enhancement.
I'll create a post on the gramps-devel mailing list to discuss this. See Proposal to use GitHub Issues. |
The heuristic looks interesting. Although I'd worry about someone deciding (retroactively) that the gender-guessing and surname-guessing had to "go away" when adding a person to a family. Citing that the gender of the Partner position was no longer a 'dependable' (as opposed to 'reasonable') assumption. I find those "guessing" features valuable in reducing data entry burden. (In fact, I added a request that "Patrilineal" surname "origin" guessing be added to the "Father's Surname" option in Preferences-Data-Input options-Surname guessing automation.) Discussed further in a discussion about SuperTool script with an Origin calculation example: https://gramps.discourse.group/t/tree-vivisection-experiments-with-the-isotammi-supertool/1621 |
Resulting discussion and feature request. https://gramps.discourse.group/t/labels-in-edit-family-dialog/6700 |
Adjust code now that get_raw_person_data returns a DataDict
2bc4d2a
to
714f69d
Compare
get_raw_person_data
now returns a DataDict.Update
FastMaleFilter.match()
andFastFemaleFilter.match()
accordingly to avoid a runtime errorSteps to reproduce the problem:
The following error is displayed: