-
Notifications
You must be signed in to change notification settings - Fork 22
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
make dump function true json #744
Conversation
I run a flow test, then do an sr3 dump. when I load the output into jslint.com, I can see that Then it ends with:
|
oh... and I skipped the *dumping: " title in my copy/paste. |
that's weird, i used another json validator and it was valid, ill take a deeper look. |
jsonlint still reports similar issues: Still indenting by 1 per component (cpost, cpump, flow, poll, ... ) I also see the same error at the end. my method of validation, is to use the dynamic_flow test from sr_insects. to start it running, then sr3 dump >kk and then copy/past the text into jsonlint.com A second method, I remove the "dumping: " from the beginning of the file, and then
If you have a different method of validating the json, please describe. |
You can see in jsonlint that all subsequent parts of the dump are offset/nested after "Configs". |
…te key, please check if the structure is good
jsonlint validates the format but gives an error about duplicate key, not sure if it should be adressed. https://jsonformatter.curiousconcept.com/# is valid, https://codebeautify.org/jsonvalidator too. |
I used your method with python3, seems to be working...
|
nope... for every configuration I test, it fails. what test data are you using? Are you starting a config? are there any configurations running, or configured when you run the dump? |
I runned the dynamic flow tests (all 36 tests passed) then i do sr3 dump. Configurations are running when I do sr3 dump: |
…te key, please check if the structure is good
…to v03_issue634
…to v03_issue634
…e some formating to make output looks like json
So it really works now. Great!... it looks a little clumsy with the enumerate mechanism, I had a look at the "Processes" loop and found I could reduce it from four lines to one in idiomatic python. The other cases do not look as simple, but are perhaps amenable to similar improvement. But it works... working beats beautiful every time. |
I tried to merge it, but the merge does not work. I'm not sure why... I might have broken it by trying to rebase. It might be better to start over with a fresh branch, and make one commit with the correct final version in it.... Yeah, I think that is the best way to go about it, you just copy/paste the final version of the dump routine into a fresh branch off of v03_wip (say v03_issue634_2?), and we will save a lot of patches. It will be one clean commit with just the final result. |
replaced by #749 |
No description provided.