Skip to content
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

Merge stable-1.6 into main #600

Merged
merged 19 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion .VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.2
1.6.3
3 changes: 3 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[codespell]
skip = ./.git,./tmp,./data,./extern,./tst,./bin,./libtool,configure,configure~,./gh-pages,./autom4te.cache,./cnf,aclocal.m4,./m4,./doc/*.log,./doc/*.html,./doc/*.txt,./doc/*.six,./doc/*.js,./doc/*.bbl,./doc/*.tex,./doc/*.bib
ignore-words-list=ist,manuel,MIS,mis
14 changes: 14 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: codespell
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- stable-*.*
jobs:
codespell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: codespell-project/actions-codespell@v2
12 changes: 3 additions & 9 deletions .github/workflows/gap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- stable-*.*
schedule:
# Every day at 3:30 AM UTC
- cron: '30 3 * * *'
Expand All @@ -14,8 +17,6 @@ jobs:
test-unix:
name: "${{ matrix.os }}${{ matrix.ABI }} / GAP ${{ matrix.gap-branch }}"
runs-on: "${{ matrix.os }}-latest"
# Don't run this twice for PRs from branches in the same repository
if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -61,34 +62,27 @@ jobs:
curl --retry 5 -L -O "https://digraphs.github.io/Digraphs/${{ env.DIGRAPHS_LIB }}.tar.gz"
tar xf "${{ env.DIGRAPHS_LIB }}.tar.gz"
- name: "Run DigraphsTestInstall"
if: ${{ always() }}
uses: gap-actions/run-pkg-tests@v2
with:
GAP_TESTFILE: "tst/github_actions/install.g"
- name: "Run DigraphsTestStandard"
if: ${{ always() }}
uses: gap-actions/run-pkg-tests@v2
with:
GAP_TESTFILE: "tst/github_actions/standard.g"
- name: "Run DigraphsTestManualExamples"
if: ${{ always() }}
uses: gap-actions/run-pkg-tests@v2
with:
GAP_TESTFILE: "tst/github_actions/examples.g"
- name: "Run DigraphsTestExtreme"
if: ${{ always() }}
uses: gap-actions/run-pkg-tests@v2
with:
GAP_TESTFILE: "tst/github_actions/extreme.g"
- uses: gap-actions/process-coverage@v2
if: ${{ always() }}
- uses: codecov/codecov-action@v3
if: ${{ always() }}

test-cygwin:
name: "cygwin / GAP master"
runs-on: windows-2019
if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }}
env:
CHERE_INVOKING: 1
steps:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- stable-*.*
schedule:
# Every day at 3:30 AM UTC
- cron: '30 3 * * *'
Expand All @@ -11,8 +14,6 @@ jobs:
lint:
name: "${{ matrix.linter }}"
runs-on: ubuntu-latest
# Don't run this twice for PRs from branches in the same repository
if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }}
strategy:
fail-fast: false
matrix:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- stable-*.*
schedule:
# Every day at 3:20 AM UTC
- cron: '20 3 * * *'
Expand All @@ -11,8 +14,6 @@ jobs:
manual:
name: "compile and upload manual"
runs-on: ubuntu-latest
# Don't run this twice for PRs from branches in the same repository
if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }}
steps:
- uses: actions/checkout@v3
- name: "Install TeX Live"
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ Wilf A. Wilson, Michael Young et al.

Licensing information can be found in the `LICENSE` file.

## Version 1.6.3 (released 13/09/2023)

This is a minor release with some bug fixes, and other issues resolved:

* There was a minor bug in the `RandomDigraph` method for `IsEulerianDigraph`,
resolved by @mtorpey
* Joe Edwards and Maria Tsalakou were incorrectly listed as authors resolved
partially by @james-d-mitchell in https://github.com/digraphs/Digraphs/pull/576
* Standardise the way that `UndirectedSpanningForest` works in relation to
mutability by @wilfwilson in https://github.com/digraphs/Digraphs/pull/582
* Add immediate methods for connected and strongly connected digraphs by
@mtorpey
* There was a minor memory leak in the kernel extension resolved by
@james-d-mitchell

## Version 1.6.2 (released 05/04/2023)

* PackageInfo.g: link to Mathjax manual by default by @fingolfin in
Expand Down
10 changes: 5 additions & 5 deletions PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
##

## <#GAPDoc Label="PKGVERSIONDATA">
## <!ENTITY VERSION "1.6.2">
## <!ENTITY VERSION "1.6.3">
## <!ENTITY GAPVERS "4.10.0">
## <!ENTITY GRAPEVERS "4.8.1">
## <!ENTITY IOVERS "4.5.1">
Expand All @@ -28,8 +28,8 @@ _STANDREWSCS := Concatenation(["Jack Cole Building, North Haugh, ",
SetPackageInfo(rec(
PackageName := "Digraphs",
Subtitle := "Graphs, digraphs, and multidigraphs in GAP",
Version := "1.6.2",
Date := "05/04/2023", # dd/mm/yyyy format
Version := "1.6.3",
Date := "13/09/2023", # dd/mm/yyyy format
License := "GPL-3.0-or-later",
ArchiveFormats := ".tar.gz",

Expand Down Expand Up @@ -122,7 +122,7 @@ Persons := [
rec(
LastName := "Edwards",
FirstNames := "Joe",
IsAuthor := true,
IsAuthor := false,
IsMaintainer := false,
Email := "je53@st-andrews.ac.uk",
PostalAddress := _STANDREWSMATHS,
Expand Down Expand Up @@ -304,7 +304,7 @@ Persons := [
rec(
LastName := "Tsalakou",
FirstNames := "Maria",
IsAuthor := true,
IsAuthor := false,
IsMaintainer := false,
Email := "mt200@st-andrews.ac.uk",
WWWHome := "https://mariatsalakou.github.io/",
Expand Down
1 change: 1 addition & 0 deletions VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#############################################################################
##

release 1.6.3 - 13/09/2023
release 1.6.2 - 05/04/2023
release 1.6.1 - 06/12/2022
release 1.6.0 - 08/09/2022
Expand Down
2 changes: 1 addition & 1 deletion ci/coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def warn_exit(msg):
QUIT_GAP(0);
'''

_RUN_GAP = '../../bin/gap.sh -A -q -m 1g -o 2g -T --cover ' + _DIR + '/profile.gz -c "' + _COMMANDS.replace('"', '\\"') + '"'
_RUN_GAP = '../../gap -A -q -m 1g -o 2g -T --cover ' + _DIR + '/profile.gz -c "' + _COMMANDS.replace('"', '\\"') + '"'

try:
pro = subprocess.Popen(_RUN_GAP, shell=True)
Expand Down
2 changes: 1 addition & 1 deletion ci/docker-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ env | grep -v "^LS_COLORS"
# Common curl settings
CURL="curl --connect-timeout 5 --max-time 40 --retry 5 --retry-delay 0 -L"
TESTLOG="$GAP_HOME/testlog.txt"
GAPSH="$GAP_HOME/bin/gap.sh"
GAPSH="$GAP_HOME/gap"
DIG_DIR="$GAP_HOME/pkg/digraphs"

################################################################################
Expand Down
2 changes: 1 addition & 1 deletion doc/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<#Include SYSTEM="z-chap0.xml"> <!-- intro -->
<#Include SYSTEM="z-chap1.xml"> <!-- installing -->
<#Include SYSTEM="z-chap2.xml"> <!-- creating -->
<#Include SYSTEM="z-chap3.xml"> <!-- operators/hashs -->
<#Include SYSTEM="z-chap3.xml"> <!-- operators/hashes -->
<#Include SYSTEM="z-chap4.xml"> <!-- attributes, operations -->
<#Include SYSTEM="z-chap5.xml"> <!-- properties -->
<#Include SYSTEM="z-chap6.xml"> <!-- homomorphisms -->
Expand Down
2 changes: 1 addition & 1 deletion doc/z-chap9.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<Item>
<E>DiSparse6</E> is a new format based on <E> Sparse6 </E>, but
designed for digraphs. In this format the list of edges is
partitioned into inceasing and decreasing edges, depending whether the
partitioned into increasing and decreasing edges, depending whether the
edge has its source bigger than the range. Then both sets of edges are
written separately in <E> Sparse6 </E> format with a separation symbol
in between.
Expand Down
40 changes: 40 additions & 0 deletions etc/tst-local-vars.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python3
"""
This simple script adds the local variables used in a GAP tst file to the top
of the file.
"""
import os
import re
import sys
import textwrap

import yaml
from bs4 import BeautifulSoup


def main():
if sys.version_info[0] < 3:
raise Exception("Python 3 is required")
args = sys.argv[1:]
pattern1 = re.compile(r"(\w+)\s*:=")
pattern2 = re.compile(r"for (\w+) in")
for fname in args:
lvars = []
with open(fname, "r") as f:
lines = f.read()
lvars.extend([x.group(1) for x in re.finditer(pattern1, lines)])
lvars.extend([x.group(1) for x in re.finditer(pattern2, lines)])
lvars = ", ".join(sorted([*{*lvars}]))
lvars = [x if x[-1] != "," else x[:-1] for x in textwrap.wrap(lvars, width=72)]
lvars = [""] + ["#@local " + x for x in lvars]
lines = lines.split("\n")
pos = next(i for i in range(len(lines)) if "START_TEST" in lines[i])
lines = lines[:pos] + lvars + lines[pos:]
lines = "\n".join(lines)
with open(fname, "w") as f:
print(f"Writing local variables to {fname}...")
f.write(lines)


if __name__ == "__main__":
main()
49 changes: 49 additions & 0 deletions etc/tst-unbind-local-vars.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env python3
"""
This simple script adds the "Unbind" statements to the end of a GAP tst file.
"""
import os
import re
import sys
import textwrap

import yaml
from bs4 import BeautifulSoup


def main():
if sys.version_info[0] < 3:
raise Exception("Python 3 is required")
args = sys.argv[1:]
pattern1 = re.compile(r"(\w+)\s*:=")
pattern2 = re.compile(r"for (\w+) in")
for fname in args:
lvars = []
with open(fname, "r") as f:
lines = f.read()
lvars.extend([x.group(1) for x in re.finditer(pattern1, lines)])
lvars.extend([x.group(1) for x in re.finditer(pattern2, lines)])
lvars = sorted([*{*lvars}])
lvars = [
"# Unbind local variables, auto-generated by etc/tst-unbind-local-vars.py"
] + [f"gap> Unbind({lvar});" for lvar in lvars]
lvars.append("")
lines = lines.split("\n")
pos1 = next(i for i in range(len(lines)) if "STOP_TEST" in lines[i]) - 1
try:
pos0 = next(
i
for i in range(len(lines))
if "etc/tst-unbind-local-vars.py" in lines[i]
)
except StopIteration:
pos0 = pos1
lines = lines[:pos0] + lvars + lines[pos1:]
lines = "\n".join(lines)
with open(fname, "w") as f:
print(f"Writing local variables to {fname}...")
f.write(lines)


if __name__ == "__main__":
main()
38 changes: 20 additions & 18 deletions gap/attr.gi
Original file line number Diff line number Diff line change
Expand Up @@ -2341,36 +2341,38 @@ InstallMethod(DigraphReflexiveTransitiveReductionAttr,
"for an immutable digraph",
[IsImmutableDigraph], DigraphReflexiveTransitiveReduction);

InstallMethod(UndirectedSpanningForest, "for a digraph by out-neighbours",
[IsDigraphByOutNeighboursRep],
InstallMethod(UndirectedSpanningForest,
"for a mutable digraph by out-neighbours",
[IsMutableDigraph and IsDigraphByOutNeighboursRep],
function(D)
local C;
if DigraphHasNoVertices(D) then
return fail;
fi;
C := MaximalSymmetricSubdigraph(D)!.OutNeighbours;
C := DIGRAPH_SYMMETRIC_SPANNING_FOREST(C);
if IsMutableDigraph(D) then
D!.OutNeighbours := C;
ClearDigraphEdgeLabels(D);
return D;
MaximalSymmetricSubdigraph(D);
D!.OutNeighbours := DIGRAPH_SYMMETRIC_SPANNING_FOREST(D!.OutNeighbours);
ClearDigraphEdgeLabels(D);
return D;
end);

InstallMethod(UndirectedSpanningForest, "for an immutable digraph",
[IsImmutableDigraph], UndirectedSpanningForestAttr);

InstallMethod(UndirectedSpanningForestAttr, "for an immutable digraph",
[IsImmutableDigraph and IsDigraphByOutNeighboursRep],
function(D)
local C;
if DigraphHasNoVertices(D) then
return fail;
fi;
C := MaximalSymmetricSubdigraph(D);
C := DIGRAPH_SYMMETRIC_SPANNING_FOREST(C!.OutNeighbours);
C := ConvertToImmutableDigraphNC(C);
SetUndirectedSpanningForestAttr(D, C);
SetIsUndirectedForest(C, true);
SetIsMultiDigraph(C, false);
SetDigraphHasLoops(C, false);
return C;
end);

InstallMethod(UndirectedSpanningForest,
"for a digraph with known undirected spanning forest",
[IsDigraph and HasUndirectedSpanningForestAttr], SUM_FLAGS,
UndirectedSpanningForestAttr);

InstallMethod(UndirectedSpanningForestAttr, "for an immutable digraph",
[IsImmutableDigraph], UndirectedSpanningForest);

InstallMethod(UndirectedSpanningTree, "for a mutable digraph",
[IsMutableDigraph],
function(D)
Expand Down
2 changes: 1 addition & 1 deletion gap/labels.gi
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ InstallMethod(SetDigraphVertexLabels, "for a digraph and list",
[IsDigraph, IsList],
function(D, names)
if Length(names) <> DigraphNrVertices(D) then
ErrorNoReturn("the 2nd arument <names> must be a list with length equal ",
ErrorNoReturn("the 2nd argument <names> must be a list with length equal ",
"to the number of vertices of the digraph <D> that is the ",
"1st argument,");
fi;
Expand Down
2 changes: 1 addition & 1 deletion scripts/check-code-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ printf "\033[1m";
printf "Running Test(\"$1\"); in GAP . . .\n";
printf "\033[0m";
printf "\033[2m";
~/gap/bin/gap.sh -A -m 1g -T <<< "Test(\"$1\"); quit;";
~/gap/gap -A -m 1g -T <<< "Test(\"$1\"); quit;";
printf "\033[0m";

printf "\033[1m";
Expand Down
2 changes: 1 addition & 1 deletion src/schreier-sims.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ uint16_t PERM_DEGREE = 0;

// Schreier-Sims set up

SchreierSims* new_schreier_sims() {
SchreierSims* new_schreier_sims(void) {
SchreierSims* ss = malloc(sizeof(SchreierSims));
ss->tmp_perm = new_perm(MAXVERTS);
for (uint16_t i = 0; i < MAXVERTS; ++i) {
Expand Down
Loading
Loading