Skip to content

Commit

Permalink
Get ready for release 5.0.0a0
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Jul 31, 2022
1 parent 643e579 commit 438c872
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
5.0.0.alpha0
------------

Track API changes in Mathics 5.0.0.

Changed to use networkx 2.8 or greater.

Some functionality has been removed for now, because networkx 2.8's API is a bit different with its new NodeView and EdgeView API.

2.3.0
-----

Expand Down
2 changes: 1 addition & 1 deletion admin-tools/pyenv-versions
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ if [[ $0 == ${BASH_SOURCE[0]} ]] ; then
echo "This script should be *sourced* rather than run directly through bash"
exit 1
fi
export PYVERSIONS='3.6.12 3.7.9 3.8.6 3.9.1'
export PYVERSIONS='3.6.13 3.7.13 3.8.13 3.9.13 3.10.5'
9 changes: 5 additions & 4 deletions pymathics/graph/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from mathics.core.symbols import Symbol, SymbolFalse, SymbolTrue
from mathics.core.systemsymbols import (
SymbolBlank,
SymbolFailed,
SymbolGraphics,
SymbolMakeBoxes,
SymbolMissing,
Expand Down Expand Up @@ -910,7 +911,7 @@ def apply(self, graph, item, name, evaluation):
"PropertyValue[{graph_Graph, item_}, name_Symbol]"
value = graph.get_property(item, name.get_name())
if value is None:
return Symbol("$Failed")
return SymbolFailed
return value


Expand Down Expand Up @@ -1688,8 +1689,8 @@ def apply(self, graph, expression, evaluation, options):

class DegreeCentrality(_Centrality):
"""
>> g = Graph[{a -> b, b <-> c, d -> c, d -> a, e <-> c, d -> b}]; Sort[DegreeCentrality[g]]
= {2, 2, 3, 4, 5}
>> g = Graph[{a -> b, b <-> c, d -> c, d -> a, e <-> c, d -> b}]; DegreeCentrality[g]
= {2, 4, 5, 3, 2}
>> g = Graph[{a -> b, b <-> c, d -> c, d -> a, e <-> c, d -> b}]; DegreeCentrality[g, "In"]
= {1, 3, 3, 0, 1}
Expand All @@ -1701,7 +1702,7 @@ class DegreeCentrality(_Centrality):
def _from_dict(self, graph, centrality):
s = len(graph.G) - 1 # undo networkx's normalization
return ListExpression(
*[Integer(s * centrality.get(v, 0)) for v in graph.vertices],
*[Integer(s * centrality.get(v, 0)) for v in graph.vertices.expressions],
)

def apply(self, graph, expression, evaluation, options):
Expand Down
2 changes: 1 addition & 1 deletion pymathics/graph/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# well as importing into Python. That's why there is no
# space around "=" below.
# fmt: off
__version__="5.0.0.dev0"
__version__="5.0.0a0" # noqa
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bdist_wheel]
universal = 1
universal = 0

[metadata]
description_file = README.rst
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def read(*rnames):
name="pymathics-graph",
version=__version__, # noqa
packages=find_namespace_packages(include=["pymathics.*"]),
install_requires=["Mathics3>=3.0.0", "networkx", "pydot", "matplotlib"],
install_requires=["Mathics3>=5.0.0", "networkx>=2.8.0", "pydot", "matplotlib"],
# don't pack Mathics in egg because of media files, etc.
zip_safe=False,
maintainer="Mathics Group",
Expand All @@ -48,6 +48,7 @@ def read(*rnames):
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Scientific/Engineering",
Expand Down

0 comments on commit 438c872

Please sign in to comment.