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
Added I/O support for JSON Graph Format #975
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #975 +/- ##
==========================================
+ Coverage 88.93% 89.02% +0.09%
==========================================
Files 94 95 +1
Lines 8267 8337 +70
==========================================
+ Hits 7352 7422 +70
Misses 915 915 |
@jgostick I am not 100% proud of my It feels like a dirty fix not no invoke Is that OK? |
@neumannrf Nice work 👍 |
this makes me very happy. I'll take a close look at it on my flight home or sooner. |
@jgostick How can I better keep the mergeability of this PR in the meantime? I see this is not expected to be looked at until |
I don't think it will actually change that much. We just need to get the V2.0 stable, then can start adding features. The master branch is currently V2.0-beta, and the dev branch is where we are merging new PRs. Every now and then we merge dev in to master and update the version number. So, if you keep yours up to date then just keep merging master into it. |
@jgostick Now that the first PRs tagged as Please let me know if there is any required adjustment. I assume, since I only added new files, there should be no conflicts with the changes that the code has been subject to in the recent months. |
Hi Rodrigo! Yes, we are just about there. It is number 2 on my to do list, after updating all the examples to version 2! I this happening next week. I will take a look at your code again, and get back to you with comments. Because it's a PR from your fork I'm not able to edit it (unless I fork your code and make a PR to YOUR repo, but that get confusing!). So talk to you early next week. |
This code is great! The only thing I commented on was the need to allow phases to be saved as well as just network data. This is not too hard to do for |
Hi @jgostick! Thanks for your detailed review and kind words of encouragement! |
If this phase business ends up being a pain, then forget it and we can live with topology io only. We could perhaps add a note to the docstring to mention that users must transfer any phase data to the network manually if they wish to keep it. |
@jgostick I went over the proposed changes and performed the modifications (wherever applicable). I hope my last two commits address the points you raised appropriately. In my replies to your comments you will see a summary/explanation of the latest commits. Please let me know if there is any pending fix that prevents the PR from being merged. I hope the PR looks good now! 🤞 |
I am a little bit puzzled by the outcome of the AppVeyor and Codecov checks. 🤔 😱 Apparently, the tests in Did I miss some huge change in the CI workflow that has caused all my (previously flawless) checks to fail? |
Ignore the appveyor checks...we added those to check windows builds, but this hasn't worked as planned and we'll be removing them. I see that you merge dev into your branch....but I'm not sure why travis didn't even build. Github was having trouble a few nights ago, so maybe something isn't fixed quite yet? |
btw if you go to travis your PR did pass...not sure if you can see this without being logged in, but this is my link |
Can you try tweaking something and repushing? That should trigger a new build that will hopefully work. |
Done! 👍 |
List of changes:
This PR adds an I/O class called
JSONGraphFormat
that is able to.save()
and.load()
network geometry files in the JSON Graph Format.The adherence to the format is enforced by means of
.__validate_json__()
, that checks the JSON file against thejgf_schema.pkl
.This validation functionality requires the
jsonschema
module, which I added toconda_requirements.txt
.Two unit tests were created for each of the
JSONGraphFormat
class methods: one for the success, one for the failure. Appropriate fixtures were created to support the tests. The new classes have 100% test coverage.Bonus: I also added
.editorconfig
to help you standardise the code formatting across many developers and IDEs.Closes #934