Skip to content

Commit

Permalink
Merge branch 'stable-1.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-mitchell committed Jan 5, 2024
2 parents 3b33696 + f0d061a commit 653b381
Show file tree
Hide file tree
Showing 16 changed files with 205 additions and 76 deletions.
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,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@v3
- uses: codespell-project/actions-codespell@v1.0
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 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
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
Loading

0 comments on commit 653b381

Please sign in to comment.