Skip to content

Commit

Permalink
Merge pull request #1 from dimpase/wwp
Browse files Browse the repository at this point in the history
this is a rebase over #34985
  • Loading branch information
MatteoCati committed Feb 15, 2023
2 parents 0d3ec5e + 73c4e44 commit 6db139e
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 1,119 deletions.
35 changes: 35 additions & 0 deletions .devcontainer/devcontainer.json
@@ -0,0 +1,35 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/debian
{
"name": "Conda",
"image": "mcr.microsoft.com/vscode/devcontainers/base:0-bullseye",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",

// Setup conda environment
"onCreateCommand": ".devcontainer/onCreate-conda.sh",

// Install additional features.
"features": {
// For config options, see https://github.com/devcontainers/features/tree/main/src/conda
"ghcr.io/devcontainers/features/conda": {
"version": "latest",
"addCondaForge": "true"
}
},
"customizations": {
"vscode": {
"extensions": [
"guyskk.language-cython",
"ms-python.isort",
"ms-toolsai.jupyter",
"ms-python.vscode-pylance",
"ms-python.pylint",
"ms-python.python",
"lextudio.restructuredtext",
"trond-snekvik.simple-rst"
]
}
}
}
14 changes: 14 additions & 0 deletions .devcontainer/onCreate-conda.sh
@@ -0,0 +1,14 @@
# Do not keep running on errors
set -e

# Create conda environment
./bootstrap-conda
conda install mamba -n base -c conda-forge -y
mamba env create --file src/environment-dev.yml || mamba env update --file src/environment-dev.yml
conda init bash

# Build sage
conda run -n sage-dev ./bootstrap
conda run -n sage-dev ./configure --with-python=/opt/conda/envs/sage-dev/bin/python --prefix=/opt/conda/envs/sage-dev
conda run -n sage-dev pip install --no-build-isolation -v -v -e ./pkgs/sage-conf ./pkgs/sage-setup
conda run -n sage-dev pip install --no-build-isolation -v -v -e ./src
1,042 changes: 0 additions & 1,042 deletions .github/workflows/ci-cygwin-minimal.yml

This file was deleted.

12 changes: 5 additions & 7 deletions .github/workflows/ci-cygwin-standard.yml
Expand Up @@ -59,13 +59,11 @@ jobs:
needs: [cygwin-stage-i-a, cygwin-stage-i-b]

cygwin-stage-ii-e:
env:
STAGE: ii-e
PREVIOUS_STAGES: i-*
TARGETS: threejs tachyon pillow jmol m4rie sympy lrcalc lcalc symmetrica cliquer libbraiding planarity rw elliptic_curves combinatorial_designs sympow
LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }}
LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }}

uses: ./.github/workflows/cygwin.yml
with:
stage: ii-e
previous_stages: i-*
targets: threejs tachyon pillow jmol m4rie sympy lrcalc lcalc symmetrica cliquer libbraiding planarity rw elliptic_curves combinatorial_designs sympow
needs: [cygwin-stage-i-a, cygwin-stage-i-b]

############################################## stage-iii ##########################################
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/ci-linux.yml
Expand Up @@ -162,41 +162,3 @@ jobs:
["maximal"]
docker_targets: "with-targets-optional"
targets_optional: '$(echo $(export PATH=build/bin:$PATH && sage-package list :experimental: --has-file "spkg-install.in|spkg-install|requirements.txt" --no-file "huge|has_nonfree_dependencies" | grep -v sagemath_doc | grep ^[p-z]))'

local-ubuntu:

runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
tox_system_factor: [conda-forge-ubuntu]
tox_packages_factor: [minimal, standard, environment, environment-optional]
env:
TOX_ENV: local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}
LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}
steps:
- uses: actions/checkout@v3
- name: Install test prerequisites
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install tox
- name: Build and test with tox
# We use a high parallelization on purpose in order to catch possible parallelization bugs in the build scripts.
# For doctesting, we use a lower parallelization to avoid timeouts.
run: |
MAKE="make -j12" tox -e $TOX_ENV -- SAGE_NUM_THREADS=4 $TARGETS
- name: Prepare logs artifact
run: |
mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; cp -r .tox/*/log "artifacts/$LOGS_ARTIFACT_NAME"
if: always()
- uses: actions/upload-artifact@v3
with:
path: artifacts
name: ${{ env.LOGS_ARTIFACT_NAME }}
if: always()
- name: Print out logs for immediate inspection
# and markup the output with GitHub Actions logging commands
run: |
.github/workflows/scan-logs.sh "artifacts/$LOGS_ARTIFACT_NAME"
if: always()
3 changes: 0 additions & 3 deletions .gitignore
Expand Up @@ -221,9 +221,6 @@ src/ENV/
src/env.bak/
src/venv.bak/

# devcontainer
/.devcontainer/devcontainer.json

# mypy
**/.mypy_cache/

Expand Down
35 changes: 12 additions & 23 deletions src/doc/en/developer/portability_testing.rst
Expand Up @@ -1164,23 +1164,7 @@ provides sample ``devcontainer.json`` configuration files
<https://github.com/sagemath/sage/tree/develop/.devcontainer/>`_ for this
purpose.

To get started, symlink (or copy) one of the sample files to
``$SAGE_ROOT/.devcontainer/devcontainer.json``. For example, choose
`$SAGE_ROOT/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json
<https://github.com/sagemath/sage/tree/develop/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json>`_, which uses the Docker image based on ``ubuntu-jammy-standard``,
the most recent
development version of Sage (``dev`` tag), and a full installation of
the Sage distribution (``with-targets``).

In macOS for example, you can do this using the shell as follows::

[mkoeppe@sage sage] $ (cd .devcontainer && ln -s portability-ubuntu-jammy-standard/devcontainer.json .)

Now start VS Code::

[mkoeppe@sage sage] $ code .

Then VS Code may prompt you whether you would like to open the current
If you open the sage folder in VS Code, it may prompt you whether you would like to open the current
directory in the dev container (yes). If it does not, use the command palette
(:kbd:`Ctrl` + :kbd:`Shift` + :kbd:`P`), enter the command "Remote-Containers:
Reopen Folder in Container" , and hit :kbd:`Enter`.
Expand All @@ -1190,6 +1174,14 @@ application, then in the command palette of VS Code, enter "Remote-Containers:
Open Folder in Container", and hit :kbd:`Enter`, and choose the directory
``$SAGE_ROOT`` of your local Sage repository.

VS Code then prompts you to choose a dev container configuration.
For example, choose "Ubuntu jammy" `.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json
<https://github.com/sagemath/sage/tree/develop/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json>`_,
which uses the Docker image based on ``ubuntu-jammy-standard``, the most recent
development version of Sage (``dev`` tag), and a full installation of
the Sage distribution (``with-targets``). Other dev container configurations
are described below.

Once VS Code starts configuring the dev container, by clicking on "show log",
you can see what it does:

Expand Down Expand Up @@ -1225,8 +1217,7 @@ in a terminal, `open a new terminal in VS Code
``configure`` script.

You can edit a copy of the configuration file to change to a different platform, another
version, or build stage. After editing the configuration file (or changing the
symlink), run "Remote-Containers: Rebuild Container" from the command
version, or build stage. After editing the configuration file, run "Remote-Containers: Rebuild Container" from the command
palette. See the `VS Code devcontainer.json reference
<https://code.visualstudio.com/docs/remote/devcontainerjson-reference>`_
and the `GitHub introduction to dev containers
Expand All @@ -1248,8 +1239,7 @@ installation of SageMath in this container by building from the current source t
project <https://hub.docker.com/r/computop/sage/>`_, providing
SnapPy, Regina, PHCPack, etc.

If you want to use one of these ``devcontainer.json`` files, symlink (or copy)
it and start VS Code as explained above. After VS Code finished configuring the
After VS Code finished configuring the
dev container, to use Sage in a terminal, `open a new terminal in VS Code
<https://code.visualstudio.com/docs/terminal/basics>`_, type ``./sage`` and hit
:kbd:`Enter`.
Expand Down Expand Up @@ -1284,8 +1274,7 @@ work without change) or to adapt them to your needs.
project <https://hub.docker.com/r/computop/sage/>`_, providing
SnapPy, Regina, PHCPack, etc.

If you want to use one of these ``devcontainer.json`` files, symlink (or copy)
it and start VS Code as explained above. After VS Code finished configuring the
After VS Code finished configuring the
dev container, to use Sage in a terminal, `open a new terminal in VS Code
<https://code.visualstudio.com/docs/terminal/basics>`_, type ``sage`` and hit
:kbd:`Enter`. (Do not use ``./sage``; this will not work because the source
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/designs/difference_family.py
Expand Up @@ -1892,7 +1892,7 @@ def get_fixed_relative_difference_set(rel_diff_set, as_elements=False):

def is_fixed_relative_difference_set(R, q):
r"""Check if the relative difference set `R` is fixed by `q`.
A relative difference set `R` is fixed by `q` if `\{qd | d \in R\}= R` (see Section 3 of [Spe1975]_).
INPUT:
Expand Down
12 changes: 10 additions & 2 deletions src/sage/combinat/matrices/hadamard_matrix.py
Expand Up @@ -90,6 +90,13 @@ def normalise_hadamard(H, skew=False):
sage: H = normalise_hadamard(skew_hadamard_matrix(20, skew_normalize=False), skew=True)
sage: is_hadamard_matrix(H, skew=True, normalized=True)
True
If ``skew`` is True but the Hadamard matrix is not skew, the matrix returned
will not be normalized::
sage: H = normalise_hadamard(hadamard_matrix(92), skew=True)
sage: is_hadamard_matrix(H, normalized=True)
False
"""

if skew:
Expand Down Expand Up @@ -2274,7 +2281,7 @@ def skew_hadamard_matrix_spence_construction(n, check=True):
r"""
Construct skew Hadamard matrix of order `n` using Spence constrution.
This function will construct skew Hadamrd matrix of order `n=2(q+1)` where `q` is
This function will construct skew Hadamard matrix of order `n=2(q+1)` where `q` is
a prime power with `q = 5` (mod 8). The construction is taken from [Spe1977]_, and the
relative difference sets are constructed using :func:`sage.combinat.designs.difference_family.relative_difference_set_from_homomorphism`.
Expand Down Expand Up @@ -2364,6 +2371,7 @@ def GS_skew_hadamard_smallcases(n, existence=False, check=True):
Namely, it needs 4 circulant matrices with extra properties, as described in
:func:`sage.combinat.matrices.hadamard_matrix.williamson_goethals_seidel_skew_hadamard_matrix`
Matrices are taken from:
* `n=36, 52`: [GS70s]_
* `n=92`: [Wall71]_
* `n=188`: [Djo2008a]_
Expand Down Expand Up @@ -2607,7 +2615,7 @@ def skew_hadamard_matrix_from_good_matrices(a, b, c, d, check=True):
- ``c`` -- (1,-1) list specifying the 1st row of `D`.
- ``check`` -- boolean: if True (default), check the the matrix is an Hadamard matrix before returning it.
- ``check`` -- boolean: if True (default), check that the matrix is a skew Hadamard matrix before returning it.
EXAMPLES::
Expand Down
4 changes: 2 additions & 2 deletions src/sage/schemes/toric/sheaf/klyachko.py
Expand Up @@ -26,7 +26,7 @@
(0, 0, 18, 16, 1)
sage: Gtilde = G_sum.random_deformation()
sage: V = Gtilde.wedge(2) * K # long time
sage: V.cohomology(dim=True, weight=(0,0,0,0)) # long time
sage: V.cohomology(dim=True, weight=(0,0,0,0)) # long time # random failure (see #32773)
(0, 0, 3, 0, 0)
REFERENCES:
Expand Down Expand Up @@ -948,7 +948,7 @@ def random_deformation(self, epsilon=None):
sage: V.cohomology(dim=True, weight=(0,))
(1, 0)
sage: Vtilde = V.random_deformation()
sage: Vtilde.cohomology(dim=True, weight=(0,))
sage: Vtilde.cohomology(dim=True, weight=(0,)) # random failure (see #32773)
(1, 0)
"""
filt = self._filt.random_deformation(epsilon)
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Expand Up @@ -272,7 +272,6 @@ setenv =
fedora-31: BASE_TAG=31
fedora-32: BASE_TAG=32
fedora-33: BASE_TAG=33
fedora-33: IGNORE_MISSING_SYSTEM_PACKAGES=no
fedora-34: BASE_TAG=34
fedora-34: IGNORE_MISSING_SYSTEM_PACKAGES=no
fedora-35: BASE_TAG=35
Expand Down

0 comments on commit 6db139e

Please sign in to comment.