-
Notifications
You must be signed in to change notification settings - Fork 37
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 seifart 410 to 408 #1381
fix seifart 410 to 408 #1381
Conversation
@FredericBlum Thanks for the update! Did you use the |
Sorry, missed that PR. Yes, you'd do a $ concepticon rename Seifart-2015-410 Seifart-2015-408 and then fix the list/items accordingly. The only other thing that @@ -30091,6 +32141,11 @@
"id": "Yakhontov-1991-35",
"comment": "renaming",
"replacement": "Yakhontov-1956-35"
+ },
+ {
+ "id": "Seifart-2015-410",
+ "comment": "renaming",
+ "replacement": "Seifart-2015-408"
}
]
} And individual mappings for all entries in a concept list: diff --git a/concepticondata/retired.json b/concepticondata/retired.json
index 3b40dc8e..899d13ea 100644
--- a/concepticondata/retired.json
+++ b/concepticondata/retired.json
@@ -29949,6 +29949,2056 @@
"id": "Yakhontov-1991-35-35",
"comment": "renaming",
"replacement": "Yakhontov-1956-35-35"
+ },
+ {
+ "id": "Seifart-2015-410-1",
+ "comment": "renaming",
+ "replacement": "Seifart-2015-408-1"
+ },
+ {
+ "id": "Seifart-2015-410-2",
+ "comment": "renaming",
+ "replacement": "Seifart-2015-408-2"
+ },
... |
Thanks for the tip, I will re-do the changes then |
I have updated the PR using the `renaming' command. Following strictly the described workflow, the list gets updated, but the individual entries do not. This means that the last entry has the following ID:
I assume that this is working as intended, so that the ID of the entry does not get changed for backwards compatibility? |
Yes, here the manual intervention mentioned above is required: Since the number of items in the list was reduced, you need to manually fix those two cases (and make sure that the |
This reverts commit 17b58a7.
I am not sure I can follow you. From what I've read above, I should run the changes in the following order:
But then the retired.json-file does not have the updated ID's, and I'd have to make 200+ manual changes to retired.json. Is there another option to re-populate the retired.json? If I first change the ID's and remove the duplicates, the remaining ID's are correctly displayed, but there is no information about the two deleted lines. What happens if any project had one of the duplicates as ID? Example: I deleted Seifart-2015-205 But since I had to do the changes BEFORE running `rename', the entry in retired.json refers to the NEW 205, not the old one. So any reference to the old Seifart-2015-205 is now wrongly referred to as the new Seifart-2015. Also, there is another problem: Running rename seems to overwrite some previous changes that have been made to retired.json, namely referring to a conceptlist from Yakhontov - how can I avoid this? |
Sorry, my brief explanation in the previous comment wasn't very helpful. Item reductions are always a bit more troublesome than item additions at the end of a list. So we begin with:
Then we fix the number of items in the After that, in the newly created ('renamed')
There's different ways of doing that and I'm not aware of any easy fully automatic way of handling that. I usually use VisiData cell replacements or you can do something like (modify as you see fit): import json
with open("retired.json") as f:
data = json.load(f)
for e in data["Concept"]:
if e["id"].startswith("Seifart"):
id_n = int(e["id"].split("-")[-1])
if id_n >= 27 and id_n < 232:
e.update({"replacement": f"Seifart-2015-408-{id_n - 1}"})
elif id_n >= 232:
e.update({"replacement": f"Seifart-2015-408-{id_n - 2}"})
print(e)
Afterwards, we manually map the two 'surplus' lines (i.e. the double mapping of
Hm, I can't reproduce this locally. For me, after running the initial @@ -29949,6 +29949,2056 @@
"id": "Yakhontov-1991-35-35",
"comment": "renaming",
"replacement": "Yakhontov-1956-35-35"
+ },
+ {
+ "id": "Seifart-2015-410-1",
+ "comment": "renaming",
+ "replacement": "Seifart-2015-408-1"
+ },
+ {
+ "id": "Seifart-2015-410-2",
+ "comment": "renaming",
+ "replacement": "Seifart-2015-408-2"
+ }, Have there been previous modifications from past calls to Hope this helps. Please let me know if it doesn't! There might also be other/better ways of doing that and I hope that someone will intervene should I be writing nonsense here. :) |
@chrzyki Thanks for the detailed lead-through. I have now fixed the list according to your guidelines, and it seems like everything worked. Can you give it a final check? |
concepticondata/retired.json
Outdated
{ | ||
"id": "Seifart-2015-410-27", | ||
"comment": "renaming", | ||
"replacement": "Seifart-2015-408-26" |
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.
The remapping is unfortunately wrong here (did you generate IDs before removing the doubles?): this maps the old ID for HEART
to the new ID for BLOOD
and propagates the wrong ID throughout the following entries.
concepticondata/retired.json
Outdated
"replacement": "Seifart-2015-408-230" | ||
}, | ||
{ | ||
"id": "Seifart-2015-410-233", |
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.
Likewise further down below.
Ah, I see the error now... I have removed the second occurrence of each concept, but your script assumes that I remove the first. I will change the code and update |
@chrzyki The latest commit should contain the correct replacements |
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.
Looks good to me, thank you very much for taking care of this!
Pull request checklist
concepticon notlinked --gloss "NEW_GLOSS"
Additional information
This PR fixes #1380 , two duplicates that we had previously missed. Are there precedents for renaming existing conceptlists? Since there is only one dataset where this is used (seifartecheverriboran) and this is only by ourselves, it will probably be not be a problem for other users.