-
Notifications
You must be signed in to change notification settings - Fork 1
Gmiguel.2 #21
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
Open
pdamianov-dev
wants to merge
4
commits into
master
Choose a base branch
from
gmiguel.2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Gmiguel.2 #21
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,31 @@ | ||
| import Project02 | ||
| import user02 | ||
| import pandas as pd | ||
| import sys | ||
| import unittest | ||
| sys.path.append("C:\\Users\\Stevens User\\Documents\\GitHub\\Team-4-Code\\seeds") | ||
| sys.path.append("C:\\Users\\Stevens User\\Documents\\GitHub\\Team-4-Code\\GMiguel") | ||
| sys.path.append("c:\\Users\\Stevens User\\Documents\\GitHub\\Team-4-Code\\src") | ||
| import user02 | ||
|
|
||
|
|
||
| class Testuser02(unittest.TestCase): | ||
| #all marriages after birth | ||
|
|
||
| def test01(self): | ||
| x = "" | ||
| s = "" | ||
| self.assertEquals(s, user02.user02("seeds/test1.ged")) | ||
|
|
||
| def test02(self): | ||
| s = "" | ||
| self.assertEquals(s, user02.user02("seeds/test2.ged")) | ||
|
|
||
| def test03(self): | ||
| s = "" | ||
| self.assertEquals(s, user02.user02("seeds/test3.ged")) | ||
| def test04(self): | ||
| s = "" | ||
| self.assertEquals(s, user02.user02("seeds/test4.ged")) | ||
| def test05(self): | ||
| s = "" | ||
| self.assertEquals(s, user02.user02("seeds/test5.ged")) | ||
|
|
||
| if __name__ == '__main__': | ||
| unittest.main() | ||
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| ''' | ||
| Author: Samantha Inneo | ||
| Sprint: Sprint 1 | ||
| Use Case: Birth dates of siblings should be more than 8 months apart or less than 2 days apart | ||
| (twins may be born one day apart, e.g. 11:59 PM and 12:02 AM the following calendar day) | ||
| ''' | ||
| import sys | ||
| import copy | ||
| sys.path.append("C:\\Users\\Stevens User\\Documents\\GitHub\\Team-4-Code\\src") | ||
| import Project02 | ||
| sys.path.append("C:\\Users\\Stevens User\\Documents\\GitHub\\Team-4-Code\\seeds") | ||
| import pandas as pd | ||
| import datetime | ||
|
|
||
| def siblingsAgeGap(gedcom_name): | ||
| # I need to gather all the siblings of each family | ||
| # check if their birthdays are more than 8 months apart | ||
| # check if their birthdays are less than 2 days apart | ||
| #return true if they are valid, false if they are not | ||
| eight_months = 240 | ||
| two_days = 2 | ||
|
|
||
| individuals = Project02.createIndividualsDataFrame(gedcom_name) | ||
| families = Project02.createFamiliesDataFrame(gedcom_name) | ||
|
|
||
| child = [] | ||
| children = copy.deepcopy(families[["Children"]]) | ||
| indi = copy.deepcopy(individuals[["ID", "Birthday"]]) | ||
| for index, row in children.iterrows(): | ||
| #indiv = copy.deepcopy(individuals[["Name", "Birthday", "Dead"]]) | ||
| if len(row["Children"]) > 1: | ||
| for i in row["Children"]: | ||
| lst = row["Children"] | ||
| for j in lst: | ||
| for k, rows in indi.iterrows(): | ||
| if lst[j] == rows[individuals["ID"]]: | ||
| child.append(rows[individuals["Birthday"]]) | ||
| for m in range(len(child)): | ||
| child2 = child[:m] + child[m:] | ||
| for l in range(len(child2)): | ||
| if ((pd.to_datetime(child[k]) - pd.to_datetime(child2[l])) > two_days) and ((pd.to_datetime(child[k]) - pd.to_datetime(child[l])) < eight_months ): | ||
| print("invalid: sibling birthdays") | ||
|
|
||
|
|
||
| siblingsAgeGap("seeds/seed.ged") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,10 @@ | ||
| ''' | ||
| Author: Grace Miguel | ||
| I pledge my honor that I've abided by the the Stevens Honor Code. | ||
| ''' | ||
| import sys | ||
| sys.path.append("c:\\Users\\Stevens User\\Documents\\GitHub\\Team-4-Code\\src") | ||
| sys.path.append("C:\\Users\\Stevens User\\Documents\\GitHub\\Team-4-Code\\testFiles") | ||
| sys.path.append("C:\\Users\\Stevens User\\Documents\\GitHub\\Team-4-Code\\seeds") | ||
|
Comment on lines
6
to
+7
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here should be using relative imports |
||
| import pandas as pd | ||
| import Project02 | ||
| from datetime import datetime | ||
|
|
@@ -11,22 +15,31 @@ def user02(gedcom_file): | |
| individuals = Project02.createIndividualsDataFrame(gedcom_file) | ||
| families = Project02.createFamiliesDataFrame(gedcom_file) | ||
| indiv = copy.deepcopy(individuals[["Name", "Birthday"]]) #makes a copy of original inviduals dataframe | ||
| print(indiv) | ||
| fam = copy.deepcopy(families[["Wife Name", "Husband Name", "Married"]]) | ||
| print(fam) | ||
|
|
||
| lst = [] | ||
| for i, row in indiv.iterrows(): | ||
| for k, rows in fam.iterrows(): | ||
| if row["Name"] == rows["Wife Name"] or row["Name"] == rows["Husband Name"]: | ||
| if row["Name"] == rows["Wife Name"]: | ||
| if type(rows["Married"]) == float and pd.isna(rows["Married"]): | ||
| print("no marriage date") | ||
| elif pd.to_datetime(row["Birthday"]) < pd.to_datetime(rows["Married"]: | ||
| print("Valid") | ||
| pass | ||
| elif pd.to_datetime(row["Birthday"]) < pd.to_datetime(rows["Married"]): | ||
| pass | ||
| else: | ||
| print("Invalid") | ||
| lst.append(row["Wife Name"]) | ||
|
|
||
| if row["Name"] == rows["Husband Name"]: | ||
| if type(rows["Married"]) == float and pd.isna(rows["Married"]): | ||
| pass | ||
| elif pd.to_datetime(row["Birthday"]) < pd.to_datetime(rows["Married"]): | ||
| pass | ||
| else: | ||
| lst.append(row["Husband Name"]) | ||
| if len(lst) > 0: | ||
| return "The following people have births after marriage" + str(lst) | ||
| else: | ||
| return "" | ||
|
|
||
| #for k, row in fam.iterrows(): | ||
|
|
||
|
|
||
| user02("testFiles/test6.ged") | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
should not use absolute file names rather use relative imports. this will not work on other peoples computers as the paths are not the same. Let me know if you need help with relative imports