Skip to content

Commit

Permalink
Merge branch 'master' into gf/BasisLieHighestWeight
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens authored Oct 27, 2023
2 parents d503df5 + 103262f commit 00168b5
Show file tree
Hide file tree
Showing 170 changed files with 4,603 additions and 2,591 deletions.
24 changes: 24 additions & 0 deletions .bibtoolrsc
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,27 @@ key.format =
{ %+8.1n(author) }
{ %2d(year) }
}

# Enforce "{...}" around fields
rewrite.rule {"^\"\([^#]*\)\"$" "{\1}"}
rewrite.rule {"^ *\([0-9]*\) *$" "{\1}"}

# Remove empty fields
rewrite.rule {"^{ *}$"}

# Unify page range separator
rewrite.rule {pages "\([0-9]+\) *\(-\|---\|–\) *\([0-9]+\)" "\1--\3"}

# Check that 1800<=year<=2029
check.rule { year "^[\"{]1[89][0-9][0-9][\"}]$" }
check.rule { year "^[\"{]20[0-2][0-9][\"}]$" }
check.error.rule { year "" "\@ \$: Year has to be a suitable number" }

# Check that the doi field is not a URL
check.error.rule { doi "\://" "\@ \$: doi field should not be a URL" }

# Check that the url field is not a DOI
check.error.rule { url "doi\.org/" "\@ \$: url field should not contain a doi. Use the doi field instead" }

# Check that no field contains a LaTeX url command, as DocumenterCitations.jl prints them ugly
check.error.rule { "\\url" "\@ \$: LaTeX's `\\url` commands are not supported" }
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
codecov:
notify:
# Keep this in sync with the number of CI jobs uploading coverage.
after_n_builds: 3
after_n_builds: 4
coverage:
status:
project:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/BibtoolCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ jobs:
sudo apt-get install -y bibtool
- name: Execute bibtool and check for changes
run: |
bibtool docs/oscar_references.bib -o docs/oscar_references.bib
bibtool docs/oscar_references.bib -o docs/oscar_references.bib 2>&1 | tee bibtool.log
test \! -s bibtool.log
rm bibtool.log
if [ -n "$(git status --porcelain)" ]; then
echo "We employ bibtool to standardize the bibtex entries of our reference list."
echo "Your changes to the bibliography do not follow this standard."
Expand Down
35 changes: 26 additions & 9 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 150
continue-on-error: ${{ matrix.julia-version == 'nightly' }}
strategy:
fail-fast: false
matrix:
Expand All @@ -27,9 +26,20 @@ jobs:
- '1.9'
- '~1.10.0-0'
- 'nightly'
group: [ 'short', 'long' ]
os:
- ubuntu-latest
depwarn: [ '' ]
include:
# Add a single job per group with deprecation errors on the most recent stable julia version
- julia-version: '1.9'
os: ubuntu-latest
group: 'short'
depwarn: 'depwarn=error'
- julia-version: '1.9'
os: ubuntu-latest
group: 'long'
depwarn: 'depwarn=error'
# Add a few macOS jobs (not too many, the number we can run in parallel is limited)
- julia-version: 'nightly'
os: macOS-latest
Expand All @@ -50,26 +60,28 @@ jobs:
if: runner.os == 'macOS'
# restrict number of openMP threads on macOS due to oversubscription
run: echo "OMP_NUM_THREADS=1" >> $GITHUB_ENV
- name: "set test subgroup"
if: ${{ matrix.group }} != ''
run: echo "OSCAR_TEST_SUBSET=${{matrix.group}}" >> $GITHUB_ENV
- name: "Run tests"
uses: julia-actions/julia-runtest@latest
with:
annotate: ${{ matrix.julia-version == '1.9' }}
coverage: ${{ matrix.julia-version == '1.9' }}
depwarn: error
depwarn: ${{ matrix.depwarn == 'depwarn=error' && 'error' || 'no' }}
- name: "Process code coverage"
if: matrix.julia-version == '1.9'
if: matrix.julia-version == '1.9' && matrix.depwarn != 'depwarn=error'
uses: julia-actions/julia-processcoverage@v1
with:
directories: src,experimental
- name: "Upload coverage data to Codecov"
if: matrix.julia-version == '1.9'
if: matrix.julia-version == '1.9' && matrix.depwarn != 'depwarn=error'
continue-on-error: true
uses: codecov/codecov-action@v3

doctest:
runs-on: ${{ matrix.os }}
timeout-minutes: 150
continue-on-error: ${{ matrix.julia-version == 'nightly' }}
strategy:
fail-fast: false
matrix:
Expand All @@ -79,7 +91,12 @@ jobs:
- 'nightly'
os:
- ubuntu-latest
depwarn: [ '' ]
include:
# Add a single job with deprecation errors on the most recent stable julia version
- julia-version: '1.9'
os: ubuntu-latest
depwarn: 'depwarn=error'
# Add macOS jobs (not too many, the number we can run in parallel is limited)
- julia-version: '1.9'
os: macOS-latest
Expand Down Expand Up @@ -108,7 +125,7 @@ jobs:
with:
annotate: ${{ matrix.julia-version == '1.9' }}
coverage: ${{ matrix.julia-version == '1.9' }}
depwarn: error
depwarn: ${{ matrix.depwarn == 'depwarn=error' && 'error' || 'no' }}
- name: "Setup package"
run: |
julia --project=docs --color=yes -e '
Expand All @@ -118,18 +135,18 @@ jobs:
- name: "Run doctests"
run: |
julia ${{ matrix.julia-version == '1.9' && '--code-coverage' || '' }} \
--project=docs --depwarn=error --color=yes -e'
--project=docs --depwarn=${{ matrix.depwarn == 'depwarn=error' && 'error' || 'no' }} --color=yes -e'
using Documenter
include("docs/documenter_helpers.jl")
using Oscar
DocMeta.setdocmeta!(Oscar, :DocTestSetup, Oscar.doctestsetup(); recursive = true)
doctest(Oscar)'
- name: "Process code coverage"
if: matrix.julia-version == '1.9'
if: matrix.julia-version == '1.9' && matrix.depwarn != 'depwarn=error'
uses: julia-actions/julia-processcoverage@v1
with:
directories: src,experimental
- name: "Upload coverage data to Codecov"
if: matrix.julia-version == '1.9'
if: matrix.julia-version == '1.9' && matrix.depwarn != 'depwarn=error'
continue-on-error: true
uses: codecov/codecov-action@v3
14 changes: 7 additions & 7 deletions docs/oscar_references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ @Article{BDLPSS13
journal = {Journal of Symbolic Computation},
volume = {51},
note = {Effective Methods in Algebraic Geometry},
pages = {99-114},
pages = {99--114},
year = {2013},
doi = {10.1016/j.jsc.2012.07.002}
}
Expand Down Expand Up @@ -695,7 +695,7 @@ @Article{FGLM93
journal = {Journal of Symbolic Computation},
volume = {16},
number = {4},
pages = {329-344},
pages = {329--344},
year = {1993},
doi = {10.1006/jsco.1993.1051}
}
Expand All @@ -707,7 +707,7 @@ @Article{FJR17
volume = {22},
number = {1},
publisher = {Mathematical Sciences Publishers},
pages = {235-303},
pages = {235--303},
year = {2017},
month = {Oct},
doi = {10.2140/gt.2018.22.235}
Expand Down Expand Up @@ -736,7 +736,7 @@ @Article{FY04
number = {3},
publisher = {Springer Science and Business Media {LLC}},
pages = {515--536},
year = 2004,
year = {2004},
month = {mar},
doi = {10.1007/s00222-003-0327-2}
}
Expand Down Expand Up @@ -1011,7 +1011,7 @@ @InCollection{IR96
title = {The {M}c{K}ay correspondence for finite subgroups of ${\rm SL}(3,\mathbb C)$},
booktitle = {Higher-dimensional complex varieties ({T}rento, 1994)},
publisher = {de Gruyter},
pages = {221-240},
pages = {221--240},
year = {1996},
location = {Berlin}
}
Expand Down Expand Up @@ -1509,8 +1509,8 @@ @MastersThesis{Peg14
title = {Chow Rings of Toric Varieties},
note = {Refereed by Prof. Dr. Eva Maria Feichtner and Dr. Emanuele Delucchi},
address = {Faculty of Mathematics},
year = 2014,
month = 9,
year = {2014},
month = {9},
school = {University of Bremen}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ localized rings should belong to the `AbsLocalizedRing` abstract type.
The basic functionality that has to be realized for any concrete instance of `AbsMultSet`
is the containment check for elements in multiplicatively closed subsets via the `in` function.

For each concrete instance of `AbsLocalizedRing`, the `Localization` constructor as well as the
For each concrete instance of `AbsLocalizedRing`, the `localization` constructor as well as the
functions `base_ring` and `inverted_set` need to be implemented. Moreover, as for any other type
of rings in OSCAR, methods for the standardized set of functions of OSCAR's
general [Ring Interface](@ref) must be supplied.
Expand Down
4 changes: 2 additions & 2 deletions docs/src/CommutativeAlgebra/ideals.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,13 @@ is_monomial(f::MPolyRingElem)
### Containment of Ideals

```@docs
is_subset(I::MPolyIdeal{T}, J::MPolyIdeal{T}) where T
is_subset(I::MPolyIdeal, J::MPolyIdeal)
```

### Equality of Ideals

```@docs
==(I::MPolyIdeal{T}, J::MPolyIdeal{T}) where T
==(I::MPolyIdeal, J::MPolyIdeal)
```

### Ideal Membership
Expand Down
4 changes: 2 additions & 2 deletions docs/src/CommutativeAlgebra/localizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ Complement
julia> RQ, p = quo(R, I);
julia> RQL, iota = Localization(RQ, U);
julia> RQL, iota = localization(RQ, U);
julia> phi = compose(p, iota);
Expand Down Expand Up @@ -340,7 +340,7 @@ Complement
julia> RQ, p = quo(R, I);
julia> RQL, iota = Localization(RQ, U);
julia> RQL, iota = localization(RQ, U);
julia> phi = compose(p, iota);
Expand Down
5 changes: 5 additions & 0 deletions docs/src/DeveloperDocumentation/new_developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ Oscar.test_module
Oscar.get_seeded_rng
```

If a test folder contains a file called `setup_tests.jl` it is included
automatically before each file (directly) in this directory. This can be used
to define helper functions that are used in multiple test files, for example
`test_save_load_roundtrip` for serialization.

### Adding documentation
For more information on docstrings, please read our page on [Documenting OSCAR
code](@ref). There are two places where documentation can be added:
Expand Down
57 changes: 57 additions & 0 deletions docs/src/DeveloperDocumentation/styleguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,63 @@ end

However, as always, rules sometimes should be broken.

## Optional arguments for parents of return values

Several objects in OSCAR have `parent`s, e.g. polynomials, group elements, ...
Whenever a function creates such objects from an input which does not involve
the output's parent, we strongly recommend that
the user should have the possibility to pass on this
parent as a keyword argument under the name `parent`.
Beyond that you can make more entry points for such parents available for
the user's convenience.

Let's see an example. Say, you want to implement the characteristic
polynomial of a matrix. You could do it as follows:
```julia
function characteristic_polynomial(A::MatrixElem)
kk = base_ring(A)
P, x = kk["x"]
AP = change_base_ring(P, A)
return det(AP - x*one(AP))
end
```
You can see that the polynomial ring `P`, i.e. the parent of the output,
is newly created in the body of the function. In particular, calling this
function two times on two different matrices `A` and `B` might produce
incompatible polynomials `p = det(A - x*one(A))` and `q = det(B - x*one(B))`
with different parents. Calling `p + q` will result in an error.

To solve this, we should have implemented the function differently:
```julia
# Implementation of the recommended keyword argument signature:
function characteristic_polynomial(
A::MatrixElem;
parent::AbstractAlgebra.Ring=polynomial_ring(base_ring(A), :t)[1]
)
AP = change_base_ring(parent, A)
x = first(gens(ring))
return det(AP - x*one(AP))
end
# Optional second signature to also allow for the specification of the
# output's parent as the first argument:
function characteristic_polynomial(
P::PolyRing,
A::MatrixElem
)
coefficient_ring(P) === base_ring(A) || error("coefficient rings incompatible")
return characteristic_polynomial(A, parent=P)
end
```
In fact this now allows for two different entry points for the parent ring `P`
of the output: First as the required `parent` keyword argument and second
as the first argument of a method of `characteristic_polynomial` with
an extended signature. Note that within the scope of the first method's body
the OSCAR function `parent` is necessarily overwritten by the name of the
keyword argument. Hence to call the actual parent of any other object, you
must then use `Oscar.parent`. E.g. to get the `MatrixSpace` of the
matrix `A`, write `Oscar.parent(A)`.


## Documentation

Expand Down
18 changes: 11 additions & 7 deletions docs/src/Experimental/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,18 @@ experimental/PACKAGE_NAME/
├── src
│   └── PACKAGE_NAME.jl
└── test
└── runtests.jl
└── *.jl
```
The files `src/PACKAGE_NAME.jl` and `test/runtests.jl` are mandatory as they
are used by Oscar.jl to find your code and tests. The file `docs/doc.main` is
used for integrating your documentation in the Oscar manual under the
`Experimental` section. Optionally please provide a `README.md` describing your
project and its goals, especially if you are starting from scratch and don't
have any documentation yet.
The file `src/PACKAGE_NAME.jl` and at least one `.jl` file in the `test/`
directory are mandatory and are used by Oscar.jl to find your code and tests.
If there is a `test/runtests.jl` then only this file is executed during
testing, otherwise all `.jl` files will be run automatically (in a random
order).

The file `docs/doc.main` is used for integrating your documentation in the
Oscar manual under the `Experimental` section. Optionally please provide a
`README.md` describing your project and its goals, especially if you are
starting from scratch and don't have any documentation yet.

!!! note
There are still older projects in `experimental` from before the
Expand Down
1 change: 1 addition & 0 deletions docs/src/PolyhedralGeometry/linear_programs.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ julia> V = optimal_vertex(LP)

```@docs
feasible_region(lp::LinearProgram)
ambient_dim(lp::LinearProgram)
objective_function(lp::LinearProgram{T}; as::Symbol = :pair) where T<:scalar_types
solve_lp(LP::LinearProgram)
optimal_value(lp::LinearProgram{T}) where T<:scalar_types
Expand Down
2 changes: 2 additions & 0 deletions docs/src/PolyhedralGeometry/mixed_integer_linear_programs.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ mixed_integer_linear_program

## Functions
```@docs
feasible_region(milp::MixedIntegerLinearProgram)
ambient_dim(milp::MixedIntegerLinearProgram)
optimal_value(milp::MixedIntegerLinearProgram{T}) where T<:scalar_types
optimal_solution
solve_milp
Expand Down
5 changes: 3 additions & 2 deletions experimental/Experimental.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ for pkg in exppkgs
if !isfile(joinpath(expdir, pkg, "src", "$pkg.jl"))
error("experimental/$pkg is incomplete: $pkg/src/$pkg.jl missing. See the documentation at https://docs.oscar-system.org/dev/Experimental/intro/ for details.")
end
if !isfile(joinpath(expdir, pkg, "test", "runtests.jl"))
error("experimental/$pkg is incomplete: $pkg/test/runtests.jl missing. See the documentation at https://docs.oscar-system.org/dev/Experimental/intro/ for details.")
path = joinpath(expdir, pkg, "test")
if !isdir(path) || length(filter(endswith(".jl"), readdir(path))) == 0
error("experimental/$pkg is incomplete: $pkg/test/ missing or empty. See the documentation at https://docs.oscar-system.org/dev/Experimental/intro/ for details.")
end
end

Expand Down
Loading

0 comments on commit 00168b5

Please sign in to comment.