summaryrefslogtreecommitdiff
path: root/networkx/readwrite/json_graph/tests
Commit message (Collapse)AuthorAgeFilesLines
* Lint using Ruff (#6371)danieleades2023-02-192-23/+29
| | | | | | | | | | | | | | | * lint and fix using ruff * add flake8-pie lints * remove useless import alias * bump version * bump deps --------- Co-authored-by: daniel.eades <daniel.eades@hotmail.com>
* Update developer requirements (#6429)Jarrod Millman2023-02-141-1/+0
| | | | | * Update developer requirements * Run linter
* Add missing asserts to tests (#6039)DiamondJoseph2022-10-124-7/+7
| | | Fixes gh-5981: Add missing asserts to tests
* signature change for `node_link` functions: for issue #5787 (#5899)Kevin Brown2022-08-111-4/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * added tests for new signature - kept all the original tests. Tagged the tests to remove after signature change is complete. - leveraged a test from test_cyctoscape.py, checks for warnings. - made new versions of tests that use attrs in the signature. * Verified that the new tests fail. Good. * update signatures with keywords * added warning message * adapted code to use keywords * move test with recwarn fixture outside of class when recwarn was used in a method, got an error. work fine in a function. * add warning to node_link_graph() * update node_link_graph() to use keywords * use recwarn in test to dectect warnings * added deprecation notices to doc strings. Needs version number for when deprecation will happen * added example code from doc string to tests * gave default values to elements of attrs the example code passes a dict with only some of the keywords defined. So the defaults needed to be provided * fixed name conflict * brace in docstring * drop braces in doc string example * Changed namespace to nx in doc string examples * update the examples - show the results of the examples - add more examples of serialization with json * Update doc desc and notes - Add reference to Serialization in the method description. - add a note that the keywords chose for the attributes names must match if the two functions are to be used together * clean up wording * document the version numbers for deprecating deprecate the change in 2.8.6 remove the change in 3.1 * Add note, on using old and new keywords together * Add Deprecation Warning to conftest.py * Add a reminder to remove code & docs in 3.1
* remove old attr keyword from json_graph/tree (#5785)Matt Schwennesen2022-06-161-17/+0
|
* update cytoscape functions to drop old signature (#5784)Dan Schult2022-06-161-17/+0
| | | update cytoscape functions with new signature
* Rm jit.py (#5751)Dilara Tekinoglu2022-06-151-66/+0
| | | Co-authored-by: dtuncturk <dilaramemis@sabanciuniv.edu>
* Use isort with pre-commit to enforce import guidelines (#5659)Mridul Seth2022-06-025-1/+11
| | | | | * Add isort to pre-commit * Run isort on all python files (except __init__.py ones)
* Add exception for unconnected graph (#5287)Dimitrios Papageorgiou2022-01-281-0/+5
|
* Compatibility updates from testing with numpy/scipy/pytest rc's (#5226)Ross Barnowski2021-12-122-10/+12
| | | | | | | * Rm deprecated scipy subpkg access. * Use recwarn fixture in place of deprecated pytest pattern. * Rm unnecessary try/except from tests.
* Remove dictionary from signature of tree_graph and tree_data (#4786)Ross Barnowski2021-05-182-102/+122
| | | | | | | | | | | | | | | * Deprecate attrs dict in json_graph.tree fns. Replace attrs dict in signature with explicit kwargs and add deprecation warning. Adds tests that the behavior isn't changed and that warnings are raised when expected. * Add deprecations to list and ignore warnings in conftest. * Modify cytoscape functions attrs deprecation. * Cleanup cytoscape test suite.
* Add FutureWarning in preparation for simplifying cytoscape function ↵Ross Barnowski2020-11-121-0/+16
| | | | | | | | | | | | | | | | | | | | signatures. (#4284) * MAINT: refactor param parsing and checking. * Add futurewarning for changing cytoscape signature. If attrs kwarg is used, raise a detailed future warning about how the function signature will change. * TST: Add tests for cytoscape futurewarning. This test should fail if the future warning is removed - useful to remind developers that the function signature should change in 3.0 * Add cytoscape signature change to deplist in docs Co-authored-by: Jarrod Millman <jarrod.millman@gmail.com>
* Improve readwrite test coverage (#4310)Jarrod Millman2020-10-311-1/+7
| | | | - tree_graph - edgelist
* fix issue #4173: cytoscape_graph(input_data) did modify the original data ↵Carlos González Rotger2020-08-251-0/+9
| | | | | | | | | | | (#4176) * fix issue #4173: readwrite.json_graph.cytoscape_graph(input_data) did modify the original data * improve test function * improve test function with @rossbar suggestion * improve function cytoscape_graph as suggested by @rossbar: direct access is better, to raise exception if "source" or "target" are not present.
* Format w/ blackJarrod Millman2020-07-105-74/+78
|
* Upgrade to Py36 syntaxJarrod Millman2020-01-011-1/+1
| | | | find networkx -name \*.py -exec pyupgrade --py36-plus {} \;
* Remove superfluous encoding informationJarrod Millman2019-11-111-1/+0
|
* PEP8 fixesJarrod Millman2019-10-184-13/+6
|
* Replace nose.raises with pytest.raises context managerJarrod Millman2019-10-124-21/+21
|
* Replace nose.assert_raises with pytest.raisesJarrod Millman2019-10-121-2/+2
|
* Remove unused importsJarrod Millman2019-10-125-5/+5
|
* Convert nose.tools.assert_* functions into assertsJarrod Millman2019-10-125-56/+56
|
* First round of pytest fixesStefan van der Walt2019-10-121-0/+0
|
* Allow jit_graph to read json string or json object (#3628)Dan Schult2019-10-031-0/+7
| | | Fixes #3197
* Pep8 fixesJarrod Millman2018-01-204-63/+61
|
* Add directed graphs support for jit_graph reading (#2753)Louis Gatin2018-01-081-1/+29
| | | | | | | | * Add directed graphs support for jit_graph reading * Solving spaces/tabs error * Add create_using argument to jit_graph. Add tests.
* Removed unused imports (#2653)James Lamb2017-10-014-4/+4
|
* Simplify base classes. (#2604)Dan Schult2017-08-124-15/+15
| | | | | | | | | | * move selfloop methods out of graph classes into function.py * replace G.node with G.nodes. fix Pickle of views * Replace G.edge with G.edges * Add a few lines of docs for release realted to this PR.
* Move data structure to private names and replace with readonly structures ↵Dan Schult2017-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#2475) * Dont assume iterators for nodes/edges/degrees (prep for views) * Add graph view classes for nodes/edges/degree * Add right set operations (not present in python3.3 KeysView * Add nodes before adding edges so python36 tests work By only adding edges, the nodes were added in order (0,1,3,2) and with the ordered nature of python3.6 dicts the tests failed. Could also fix by using nodelist on each call to to_convert_... * weighted graph convert tests testing empty graphs The edge iterator was exhausted for source before being used for dest * allow DegreeView to include case of nbunch * Make node/edge/degree properties of Graph * View contains fix and Viewers can return self. More tests * Add more tests including one for #2347 * Add nbunch tests and pep8 * Rename to EdgeView and EdgeDataView * docs tweaks and pep8 * fix up nodeDataView contains. Add and clean up tests. * Change the graph attributes to read-only properties * Reframe views code and extend _node to all networkx (still need examples) * Clean up and pep8 for view changes * ername AtlasViews, simplify code and add docstrings * Make G[u] return a view, and catch some doc bugs * Update views to use _node,_adj. Add len to EdgeDataView * minor adjustments to example subclass/printgraph
* Fixed bug on custom attrs usage: unavailable iteritems method for dict.Ramil Nugmanov2017-05-251-0/+16
| | | | also set and dict creation changed.
* Merge pull request #2366 from rhilenova/bugfix-for-issues-2328-and-2332Aric Hagberg2017-04-021-1/+17
|\ | | | | Fix for issues #2328 and #2332
| * Test expected DiGraph, but was implemented with Graph.Rhile Nova2017-02-131-1/+1
| |
| * Changes to remove integer maping from node_link format.Rhile Nova2017-02-131-1/+17
| |
* | Fixed various bugsTristan Poupard2017-01-191-3/+12
| | | | | | | | Improved tests
* | Added cytoscape JSON handlingPhobia2016-12-231-0/+58
|/
* Remove attr_dict calls to graph's add_node; replace with **.thegreathippo2016-04-261-1/+1
| | | | | | Combing through the code for any point where it pushes a dictionary to the add_node method rather than keywords; augmenting these arguments with ** to turn them into keyword arguments.
* removed temporary files from test.Francois Malassenet2016-04-171-10/+2
| | | | implemented jfinkels' comment to_tuple
* bad end of line fixed.Francois Malassenet2016-04-171-1/+1
|
* node_link_graph converts node lists into tuplesFrancois Malassenet2016-04-171-1/+1
| | | | added to_tuple to utils.misc
* node_link_graph converts node lists into tuplesFrancois Malassenet2016-04-171-0/+18
| | | | added to_tuple to utils.misc
* Generalize and improve docstrings of node_link.pyMichael-E-Rose2016-02-231-19/+19
|
* Change all X.add_path yp nx.add_path(X,Dan Schult2016-02-021-2/+2
|
* Update jit_graph and testsMridul Seth2016-01-221-6/+18
|
* Add jit_graph and testsMridul Seth2016-01-161-0/+17
|
* node-link repr. contains graph dict 'as is'jandanielr2014-10-071-2/+2
|
* Allow JSON attributes to be customizedysitu2014-05-303-4/+22
|
* Remove JSON serializer helpersAric Hagberg2014-04-201-49/+0
| | | | | | | This complexity isn't really needed. You can simply write >>> import json >>> s = json.dumps(json_graph.node_link_data(G))
* JSON graph fix to handle unicode dict keysAric Hagberg2013-10-221-0/+14
|
* Fix multigraph handling with node-link format.Aric Hagberg2013-01-261-4/+7
| | | | Addresses #827
* Whitespace cleanup. Copy before pop.Aric Hagberg2013-01-261-1/+12
| | | | Make sure we copy any data before we modify it so the input data is preserved.