Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,19 @@ sage: GC.cohomology_basis(4,6)
```

Extensive examples of the use of this software are contained in the author's PhD dissertation: [*The action of Kontsevich's graph complex on Poisson structures and star products: an implementation*](https://doi.org/10.25358/openscience-9274).

## Installation in a virtual Python environment (no SageMath installation required)

Create and activate a virtual environment:

cd /path/to/gcaops-master/
python3 -m venv venv_gcaops
. venv_gcaops/bin/activate

Install the package in the virtual environment:

pip install ".[passagemath]"

This automatically installs the modularized parts of the Sage library that are
needed by the package. (These modularized distributions are provided by
https://github.com/passagemath.)
5 changes: 4 additions & 1 deletion gcaops/util/directed_graph_sage.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import subprocess
import os
import sage.all # make SageMath work when called from Python
try:
import sage.all # make SageMath work when called from Python
except ImportError:
import sage.all__sagemath_graphs
from sage.env import SAGE_NAUTY_BINS_PREFIX
from sage.graphs.digraph import DiGraph
from sage.graphs.graph import Graph
Expand Down
5 changes: 4 additions & 1 deletion gcaops/util/formality_graph_sage.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import itertools
import subprocess
import os
import sage.all # make SageMath work when called from Python
try:
import sage.all # make SageMath work when called from Python
except ImportError:
import sage.all__sagemath_graphs
from sage.env import SAGE_NAUTY_BINS_PREFIX
from sage.graphs.digraph import DiGraph
from gcaops.graph.formality_graph import FormalityGraph
Expand Down
5 changes: 4 additions & 1 deletion gcaops/util/undirected_graph_sage.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import subprocess
import os
import sage.all # make SageMath work when called from Python
try:
import sage.all # make SageMath work when called from Python
except ImportError:
import sage.all__sagemath_graphs
from sage.env import SAGE_NAUTY_BINS_PREFIX
from sage.graphs.graph import Graph
from gcaops.graph.undirected_graph import UndirectedGraph
Expand Down
9 changes: 9 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,12 @@ classifiers =
packages = find:
python_requires = >= 3
install_requires =

[options.extras_require]
passagemath =
passagemath-graphs
passagemath-groups
passagemath-modules
passagemath-nauty
passagemath-plot
passagemath-repl
9 changes: 9 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[tox]
envlist = passagemath

[testenv:passagemath]
extras =
passagemath

commands =
python3 -c "from sage.all__sagemath_categories import QQ; from gcaops.all import *; GC = UndirectedGraphComplex(QQ, implementation='vector', sparse=True); GC.cohomology_basis(4,6)"