Skip to content

Commit

Permalink
Merge pull request #88 from arthur-schnitzler/main
Browse files Browse the repository at this point in the history
code updates
  • Loading branch information
csae8092 authored Sep 9, 2024
2 parents 245f2d2 + a31e1bb commit 78a21f8
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
POSTGRES_DB: github_actions
services:
postgres:
image: postgres:13
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
Expand Down Expand Up @@ -45,4 +45,4 @@ jobs:
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./coverage.xml
fail_ci_if_error: false
fail_ci_if_error: false
113 changes: 113 additions & 0 deletions notebooks/issue__206_fix_wrong_deathrelationdates.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "7a5ef163",
"metadata": {},
"outputs": [],
"source": [
"from tqdm import tqdm"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "219eac44",
"metadata": {},
"outputs": [],
"source": [
"col = Collection.objects.filter(name__icontains=\"neue fackel\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "5ede149f",
"metadata": {},
"outputs": [],
"source": [
"fackel_persons = Person.objects.filter(collection__in=col)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e9f97bf6",
"metadata": {},
"outputs": [],
"source": [
"for x in tqdm(fackel_persons, total=fackel_persons.count()):\n",
" birth = PersonPlace.objects.filter(related_person=x).filter(relation_type__name=\"geboren in\").first()\n",
" death = PersonPlace.objects.filter(related_person=x).filter(relation_type__name=\"gestorben in\").first()\n",
" if birth and death:\n",
" if death.start_date_written:\n",
" birth_rel_date = birth.start_date_written\n",
" death_rel_date = death.start_date_written\n",
" if birth_rel_date == death_rel_date:\n",
" death.start_date_written = x.end_date_written\n",
" death.save()\n",
" "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "14f9254b",
"metadata": {},
"outputs": [],
"source": [
"x.start_date_written"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3782da04",
"metadata": {},
"outputs": [],
"source": [
"PersonPerson.objects.all().count()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a812cae8",
"metadata": {},
"outputs": [],
"source": [
"dir(PersonPerson)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3a5fb626",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Django Shell-Plus",
"language": "python",
"name": "django_extensions"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
3 changes: 2 additions & 1 deletion templates/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ <h6>Lizenz der Inhalte: <a href="https://creativecommons.org/licenses/by/4.0/dee
</div>
<div class="textwidget custom-html-widget">
<a href="https://github.com/arthur-schnitzler/pmb-service">
<small><i class="bi bi-github" style="color: #9B5F98"></i></small>
<i class="bi bi-github fs-2" style="color: #9B5F98" aria-hidden="true"></i>
<span class="visually-hidden">GitHub repo</span>
</a>
</div>
</div>
Expand Down

0 comments on commit 78a21f8

Please sign in to comment.