Conversation
* Start a character table roundtrip test. * Document what is in the various directories * Add code to generate GNU Readline inputrc's * Split off generate code into its own directory.
|
Failure seen in recent commit: |
Ohh, I see. |
|
Hum, I was not able to reproduce the tests locally: |
Ohh, I get it, the test isn't properly implemented: when the unicode equivalent of named character is precisely the WL unicode rerepresentation ( For example, if we were to include There's three way we can deal with this:
Personally, I think we should go with the second solution. The JSON tables really are an implementation detail and users should not expect them to include each and every existing named character, some of them don't have unicode equivalents/inverses and some of them are redundant when it comes to the conversion scheme. When it comes to the tests, we should test |
|
@rocky If you really want to tests the tables themselves, we should test the YAML table, not the JSON tables. |
If that were the case then nothing would have failed. So this is not why the test is failing. In fact, if you go back to the data before your most recent changes the test was not failing. The most likely explanation of why things are failing is that something was marked invertable when it wasn't.
Please do. In fact I had asked you before about going over adding comments in the YAML like the ones I added about subtllties or why a decision was made to do something in the way it was done.
It is early enough that this is fine too. But aslo note as mentioned yesterday in a chat comment there are two kinds of unicode and there needs to be a way to indicate which unicode you want. The data in the YAML should be designed to so that there isn't duplication of anything and so by definition it will be self consistent. What we are checking in the tests is the JSON generated from the YAML. There are probably some things that can be tested in the JSON alone, For example that escape sequences for in inputrc start and in in an escape. However there are going to be some things where we have to compare YAML against JSON. Some of these could be counts for example: that the number of letterlike entires in the YAML is the same number of letterlike entries in JSON tables. And you should be the one who should have been writing this all along. And it would be nice if I wouldn't have to remind you as many times as I have to do this. You seem to prioritize doing more tasks which potentially (and some cases do) break things over completing large breaking tasks undertook before. This makes it is unpleasant for me to work on this project. Untill we have a release of everything would you please stop doing new things and focus on shoring up what we currently have. Make a pass over the developer docs (I still haven't merged in the character table stuff in that project but I will do so soon). And add more tests here. Untill we have finished with the release of everything. please don't work on incorprating unicode into formatting. |
Take a look at the JSON data and you'll see This is failing right now because I implemented this optimization yesterday. As I've shown in my previous comment, the roundtrip does work if you use
Ok, I'll add extra notes about this in
Fair enough, but this is already handled by the
I disagree with this a bit. Yes the data should be self-consistent (in fact, it is), but even when a key is redundant it should be listed in the YAML table. The point of the YAML table is that we have all of the information in a single place, even if the data is redundant.
Absolutely. For example, we probably should check if there are redundant keys in any of the JSON tables (because there shouldn't be). I guess my point is that anything concerning conversions should be tested with the conversion routines, not the raw tables.
I didn't implement the test because I don't know how pytest works and I didn't know how to set that up, but now you've added the tests I can work on those. I'll work on implementing everything we discussed in here today. |
Ok. Then the simple adjustment is to iterate over the keys of the JSON table. However we need to cross check against the YAML data (using the JSON key) to see if the character is invertable. If it is, then the assert as written should be done.
Great! Also add some these notes to the YAML file as well. Don't assume people will look at Python files to understand how data is organized in the YAML file and sublteties the YAML data might have. It is okay in the YAML file to refer to the Python program docstring as well.
Ok. Great do what you can. But let's also learn from this. There is this pattern of starting something a bit ambitious and a little more than you can handle all on your own. That's okay and best done after a release. But right now we are trying to solidify what has already been done so we can get it out there. So moving onto new projects right now is a bad idea. I really regret not having put out a relase after the Django separation was done. And then having this release which woudn't have included that as part of this release but just the things since then. |
|
I have to go now, but I'll work on more tests, documentation and fixing the errors later today. @rocky I'll also properly answer your last comment when I come back. |
Hum, makes sense. I ended up using the conversion routines instead of key-lookup (as I had proposed), but I'll the checks you described too.
Makes sense too. I'll add the notes to the YAML and the README too.
I agree. There was also a communication deficit on my part. The algorithms for resolving translations ended up being quite involved, with settle optimizations, and I failed to communicate with you guys as it developed. |
|
@rocky That's interesting: https://github.com/Mathics3/mathics-scanner/pull/8/checks?check_run_id=1801929677 led me to find a bug in the official Wolfram listing of named characters (both |
|
@rocky I finally got the tests to pass. The sanity tests I implemented caught multiples little errors in the YAML table. I wasn't expecting so many, but I'm glad we caught them. Anyway, I wrote all the tests I thought would be relevant, is there something else you'd like to include in the tests? I'll work on documentation later today. |
|
It's also worth noting this tests only guarantee the YAML data is consistent (they don't have any way of knowing if there's a better choice for translating a character or not). |
Um, ok. This isn't the first time I've noticed you use CI where others typically test locally. However, if that's going to be the case, it is much preferable that you do that in in a smaller module like this one rather than on Mathics which takes 15 minutes per run and consumes massive resources. I suspect the one reason we are getting longer delay times when starting Travis is because it keeps an account of testing time we use. I don't know if it is still the situation, but they used to keep a running average of the resources used and if you exceeded a thresshold, your jobs would start getting delayed more often. |
|
Ok. Thanks for doing all of this! As I watched the commits flying by, one thing that struck me is that there is a lot of the same code that reads in YAML and JSON data. Maybe a helper function in a common module would be useful. Also, within a test maybe the data could be read in just once instead of in each test. |
Yeah, I have the habit of doing so, mainly because I'm quite unexperienced when it comes to developing software for production and because I never can get pytest to work on my machine. I just tried running
Sure, I'll work on that after the documentation. |
Ok. Some weekend we should go over your setup to make sure you can run pytest. |
|
@rocky There's still some things missing before we can release the package:
Check-out |
|
@rocky I implemented all the tests you asked for and all of the tests I thought were relevant. Please let me know if there's something else you want me to implement. For now, I get to work on other things I'm interested in. |
Fixed the general sanity tests
I removed the part of the code that printed header comments because it's better for users in general to have control over that (they can write their own header if they want to)
|
@GarkGarcia just had a chance to look at in more detail. Overall looks pretty good. I updated a docstring and added a couple of tests. Look over if you have a chance. Tomorrow, I'll look at the other PR, try merging them in and cutting a release of this part. |
@GarkGarcia I notice that already this is detecting a mismatch on what you recently commited today.