-
Notifications
You must be signed in to change notification settings - Fork 3
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
Failure with no user-oriented error message #64
Comments
Dear @cmsmcq - thanks for your interest in teiphy! The problem is that the code assumes that there is a listWit (https://guidelines.tei-c.de/en/html/ref-listWit.html) in the sourceDesc and there wasn't enough error checking to detect the problem. @jjmccollum and I will fix that but in the meantime, here is your TEI file with the listWit added. Hopefully this should work in the current version. (I've added a .txt suffix because github doesn't allow uploading .xml) |
Hi @jjmccollum - if there is no listWit, should teiphy raise an error or should it look for witnesses from the different readings? Also, I don't think we check if there are different witnesses in the readings than in listWit. Should there be an error if a reading has a witness that hasn't been defined or should it just add it to the list. My feeling is that it might be good to just add witnesses as it goes. That means that you wouldn't need to add a listWit if you didn't need to give any extra info about the witnesses. What do you think? |
Thank you, @rbturnbull - I confirm that if I include a And for the record: if the listWit includes only a subset of the witnesses, I get output for those witnesses. If the listWit includes a witness not included in any app elements, I get output for the listed witnesses, with question marks for the ghost. I suspect that for some users, raising warnings might be helpful in these cases, but for the experimentation I currently have in view, the current behavior seems fine to me. For what it's worth, I will note in passing that after filing the bug report and looking more carefully at the example from Ephesians pointed to from the documentation, I did add a So if it's not too inconvenient, I would urge the developers to find and read the And if there is none, then you do have one user who would find it intuitive if the default behavior in the absence of a |
Thanks very much @cmsmcq. It's great to have your feedback. That all makes a lot of sense. I'll talk about these issues when @jjmccollum is available after Christmas. |
All right, I'm back from vacation! @cmsmcq Thanks for bringing this up, and @rbturnbull, thanks for identifying the issue and offering some suggestions! Based on the TEI Guidelines for the Regarding the preferred behavior if there is no As for @rbturnbull's suggestion of populating the witness list from the I can start implementing these changes in a |
that all sounds great @jjmccollum |
@rbturnbull I've just pushed some changes to the |
thanks @jjmccollum - I'll have a look tomorrow |
@rbturnbull Just wanted to follow up with you to see if you had any further suggestions for changes on the |
Hi @jjmccollum - I'm so sorry for the delay. The changes look great. Terrific work! My only suggestion is to perhaps subclass Exception so that it is more specific than just a generic 'Exception' for when there isn't a listWit element. Or you can find a more informative built-in exception class. I think it's usually a good practice to be specific so that users can catch the exception they want and not just any and all exceptions. |
Describe the bug
When I run teiphy on a sample document specifying the output file temp.nex, I get what appears to be a Python stack trace (highlighting lines main.py:111, collation.py:1113, and collation.py:325), followed by the message "ValueError: max() arg is an empty sequence".
If I specify temp.phy as the output, the stack trace hits main.py:111, collation.py:1126, and collation.py:625.
If I specify temp.fasta as the output, the stack trace hits main.py:111, collation.py:1129, and collation.py:695.
If I specify temp.csv or temp.tsv, I get no stack trace and a three-character output file consisting of two double quotes and a newline charater.
To Reproduce
This happens whenever I try to run teiphy on my TEI document.
Expected behavior
My initial vague expectation (this is my first attempt to use teiphy) was that I would get output.
Failing that, I was hoping for a message to suggest what has gone wrong. Maybe my input is not as expected, maybe my setup is not as expected.
Error message
I'll attach a log file.
Environment
python3 --version
returns "Python 3.10.6"pip install teiphy
, so I guess it should be the release of 18 Dec 2022.Additional context
I am not a regular Python user, so I may easily have failed to do something that any rational Python user would know needs to be done. I have not used teiphy before, so I don't know that my input file satisfies the expectations of the software. I would consult the documentation to find out what those expectations are, but I do not know where to find it. (Aha. Clicking on the link on the repo splash page takes me to an online version of the documentation. I don't see any description there of expectations regarding the TEI input document.)
In other words, the error here is almost certainly mine, or something odd in my environment; I am reporting it as an issue only because I don't know where else to get help. (And my problems may suggest ways in which the software and documentation might be bullet-proofed against cheerful idiot users like me.)
I have placed the input file in input.zip, since Github seems not to like the idea of attaching an XML document to an issue.
input.zip
installation-20221222.log
run.log
The text was updated successfully, but these errors were encountered: