From c49ca241fcecab35fd5b0b256295ee88b708b5bc Mon Sep 17 00:00:00 2001 From: Abel Soares Siqueira Date: Fri, 29 Sep 2023 10:25:34 +0200 Subject: [PATCH] Apply COPIERTemplate --- .JuliaFormatter.toml | 10 +- .cirrus.yml | 2 +- .copier-answers.yml | 14 + .editorconfig | 10 + .github/workflows/Breakage.yml | 12 +- .github/workflows/CommentPR.yml | 5 +- .github/workflows/CompatHelper.yml | 44 ++- .github/workflows/Copier.yml | 52 ++++ .github/workflows/Docs.yml | 51 ++++ .github/workflows/Documentation.yml | 23 -- .github/workflows/Lint.yml | 36 +++ .github/workflows/TagBot.yml | 52 +++- .github/workflows/{ci.yml => Test.yml} | 133 +++++---- .github/workflows/format_pr.yml | 32 --- .gitignore | 9 +- .markdown-link-config.json | 7 + .markdownlint.json | 13 + .pre-commit-config.yaml | 55 ++++ .yamllint.yml | 2 + .zenodo.json | 24 -- CITATION.bib | 8 - CITATION.cff | 38 +++ LICENSE | 373 ++++++++++++++++++++++++ LICENSE.md | 379 ------------------------- Project.toml | 10 - README.md | 20 +- docs/make.jl | 31 +- docs/src/contributing.md | 26 ++ docs/src/developer.md | 89 ++++++ docs/src/solvers.md | 4 +- src/R2.jl | 6 +- src/tron.jl | 4 +- test/Project.toml | 15 + 33 files changed, 993 insertions(+), 596 deletions(-) create mode 100644 .copier-answers.yml create mode 100644 .editorconfig create mode 100644 .github/workflows/Copier.yml create mode 100644 .github/workflows/Docs.yml delete mode 100644 .github/workflows/Documentation.yml create mode 100644 .github/workflows/Lint.yml rename .github/workflows/{ci.yml => Test.yml} (64%) delete mode 100644 .github/workflows/format_pr.yml create mode 100644 .markdown-link-config.json create mode 100644 .markdownlint.json create mode 100644 .pre-commit-config.yaml create mode 100644 .yamllint.yml delete mode 100644 .zenodo.json delete mode 100644 CITATION.bib create mode 100644 CITATION.cff create mode 100644 LICENSE delete mode 100644 LICENSE.md create mode 100644 docs/src/contributing.md create mode 100644 docs/src/developer.md create mode 100644 test/Project.toml diff --git a/.JuliaFormatter.toml b/.JuliaFormatter.toml index 15fa6547..bee44f1a 100644 --- a/.JuliaFormatter.toml +++ b/.JuliaFormatter.toml @@ -1,7 +1,7 @@ -margin = 100 +annotate_untyped_fields_with_any = false indent = 2 -whitespace_typedefs = true -whitespace_ops_in_indices = true +margin = 100 +normalize_line_endings = "unix" remove_extra_newlines = true -annotate_untyped_fields_with_any = false -normalize_line_endings = "unix" \ No newline at end of file +whitespace_ops_in_indices = true +whitespace_typedefs = true diff --git a/.cirrus.yml b/.cirrus.yml index ae905209..792aad12 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -2,7 +2,7 @@ task: matrix: - name: FreeBSD freebsd_instance: - image_family: freebsd-13-2 + image_family: freebsd-13-1 env: matrix: - JULIA_VERSION: 1.6 diff --git a/.copier-answers.yml b/.copier-answers.yml new file mode 100644 index 00000000..d721632f --- /dev/null +++ b/.copier-answers.yml @@ -0,0 +1,14 @@ +# Changes here will be overwritten by Copier +AddMacToCI: true +AddWinToCI: true +AuthorEmail: abel.s.siqueira@gmail.com +AuthorName: Abel Soares Siqueira +JuliaMinVersion: '1.6' +License: MPL-2.0 +PackageName: JSOSolvers +PackageOwner: JuliaSmoothOptimizers +PackageUUID: e288b6ff-ca66-4c77-99ae-94f218a9c988 +RunJuliaNightlyOnCI: true +UseCirrusCI: true +_commit: v0.2.0 +_src_path: https://github.com/abelsiqueira/COPIERTemplate.jl diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..9f5c55fc --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +# https://editorconfig.org +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +indent_size = 2 +indent_style = space +trim_trailing_whitespace = true diff --git a/.github/workflows/Breakage.yml b/.github/workflows/Breakage.yml index b2b4fabb..16d385ac 100644 --- a/.github/workflows/Breakage.yml +++ b/.github/workflows/Breakage.yml @@ -12,10 +12,11 @@ jobs: strategy: fail-fast: false matrix: - pkg: [ - "JuliaSmoothOptimizers/FletcherPenaltySolver.jl", - "JuliaSmoothOptimizers/Percival.jl" - ] + pkg: + [ + "JuliaSmoothOptimizers/FletcherPenaltySolver.jl", + "JuliaSmoothOptimizers/Percival.jl", + ] pkgversion: [latest, stable] steps: @@ -37,9 +38,8 @@ jobs: ${{ runner.os }}-test- ${{ runner.os }}- - uses: julia-actions/julia-buildpkg@v1 - # Breakage test - - name: 'Breakage of ${{ matrix.pkg }}, ${{ matrix.pkgversion }} version' + - name: "Breakage of ${{ matrix.pkg }}, ${{ matrix.pkgversion }} version" env: URL: ${{ matrix.pkg }} VERSION: ${{ matrix.pkgversion }} diff --git a/.github/workflows/CommentPR.yml b/.github/workflows/CommentPR.yml index 043113f7..16c2a97e 100644 --- a/.github/workflows/CommentPR.yml +++ b/.github/workflows/CommentPR.yml @@ -16,7 +16,7 @@ jobs: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' steps: - - name: 'Download artifact' + - name: "Download artifact" uses: actions/github-script@v3.1.0 with: script: | @@ -37,8 +37,7 @@ jobs: var fs = require('fs'); fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data)); - run: unzip pr.zip - - - name: 'Comment on PR' + - name: "Comment on PR" uses: actions/github-script@v6 with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index 67b7a104..7825cfe7 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -1,19 +1,49 @@ +# CompatHelper v3.5.0 name: CompatHelper on: schedule: - - cron: '00 00 * * *' + - cron: 0 0 * * * + workflow_dispatch: + +permissions: + contents: write + pull-requests: write jobs: CompatHelper: runs-on: ubuntu-latest steps: - - uses: julia-actions/setup-julia@latest + - name: Check if Julia is already available in the PATH + id: julia_in_path + run: which julia + continue-on-error: true + - name: Install Julia, but only if it is not already available in the PATH + uses: julia-actions/setup-julia@v1 with: - version: 1 - - name: Pkg.add("CompatHelper") - run: julia -e 'using Pkg; Pkg.add("CompatHelper")' - - name: CompatHelper.main() + version: "1" + arch: ${{ runner.arch }} + if: steps.julia_in_path.outcome != 'success' + - name: "Add the General registry via Git" + run: | + import Pkg + ENV["JULIA_PKG_SERVER"] = "" + Pkg.Registry.add("General") + shell: julia --color=yes {0} + - name: "Install CompatHelper" + run: | + import Pkg + name = "CompatHelper" + uuid = "aa819f21-2bde-4658-8897-bab36330d9b7" + version = "3" + Pkg.add(; name, uuid, version) + shell: julia --color=yes {0} + - name: "Run CompatHelper" + run: | + import CompatHelper + CompatHelper.main() + shell: julia --color=yes {0} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: julia -e 'using CompatHelper; CompatHelper.main()' + COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} + # COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} diff --git a/.github/workflows/Copier.yml b/.github/workflows/Copier.yml new file mode 100644 index 00000000..2ecd8792 --- /dev/null +++ b/.github/workflows/Copier.yml @@ -0,0 +1,52 @@ +name: Copier Update + +on: + schedule: + - cron: 0 7 1/7 * * + workflow_dispatch: + +jobs: + Copier: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.COPIER_PAT }} + - uses: julia-actions/setup-julia@v1 + with: + version: "1" + - name: Use Julia cache + uses: julia-actions/cache@v1 + - name: Install JuliaFormatter.jl + run: julia -e 'using Pkg; pkg"add JuliaFormatter"' + - name: Setup Python + uses: actions/setup-python@v4 + - name: Check for update in the template + run: | + pip install copier + copier update -A -o rej + echo -e "Automated changed by Copier.yml workflow\n" > /tmp/body.md + echo -e 'Rejected changes (if any):\n```diff\n' >> /tmp/body.md + find . -name "*.rej" | xargs cat >> /tmp/body.md + find . -name "*.rej" | xargs rm -f + echo -e '```' >> /tmp/body.md + git diff + - name: Run pre-commit to run the formatters + run: | + pip install pre-commit + pre-commit run -a || true # Ignore pre-commit errors + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.COPIER_PAT }} + commit-message: ":robot: COPIERTemplate.jl update" + title: "[AUTO] COPIERTemplate.jl update" + body-path: /tmp/body.md + branch: auto-copier-template-update + delete-branch: true + labels: configuration, automated pr, no changelog + - name: Check outputs + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/.github/workflows/Docs.yml b/.github/workflows/Docs.yml new file mode 100644 index 00000000..6a1bd878 --- /dev/null +++ b/.github/workflows/Docs.yml @@ -0,0 +1,51 @@ +name: Docs + +on: + push: + branches: + - main + paths: + - "docs/**" + - "src/**" + - "*.toml" + tags: ["*"] + pull_request: + branches: + - main + paths: + - "docs/**" + - "src/**" + - "*.toml" + types: [opened, synchronize, reopened] + +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + +jobs: + docs: + name: Documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: "1" + - run: | + julia --project=docs -e ' + using Pkg + Pkg.develop(PackageSpec(path=pwd())) + Pkg.instantiate()' + - run: | + julia --project=docs -e ' + using Documenter: DocMeta, doctest + using JSOSolvers + DocMeta.setdocmeta!(JSOSolvers, :DocTestSetup, :(using JSOSolvers); recursive=true) + doctest(JSOSolvers)' + - run: julia --project=docs docs/make.jl + env: + JULIA_PKG_SERVER: "" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml deleted file mode 100644 index be0b8658..00000000 --- a/.github/workflows/Documentation.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Documentation -on: - push: - branches: - - main - tags: '*' - pull_request: - types: [opened, synchronize, reopened] -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@latest - with: - version: '1' - - name: Install dependencies - run: julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - - name: Build and deploy - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} - run: julia --project=docs --color=yes docs/make.jl diff --git a/.github/workflows/Lint.yml b/.github/workflows/Lint.yml new file mode 100644 index 00000000..c9f779b6 --- /dev/null +++ b/.github/workflows/Lint.yml @@ -0,0 +1,36 @@ +name: Lint + +on: + push: + branches: + - main + tags: ["*"] + pull_request: + +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + +jobs: + lint: + name: Linting + runs-on: ubuntu-latest + steps: + - name: Clone + uses: actions/checkout@v3 + - name: Setup Julia + uses: julia-actions/setup-julia@v1 + with: + version: "1" + - name: Use Julia cache + uses: julia-actions/cache@v1 + - name: Install JuliaFormatter.jl + run: julia -e 'using Pkg; pkg"add JuliaFormatter"' + - name: Setup Python + uses: actions/setup-python@v4 + - name: Install pre-commit + run: pip install pre-commit + - name: Run pre-commit + run: SKIP=no-commit-to-branch pre-commit run -a diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index 083baf95..dab9b0b6 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -1,15 +1,37 @@ -name: TagBot -on: - issue_comment: - types: - - created - workflow_dispatch: -jobs: - TagBot: - if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' - runs-on: ubuntu-latest - steps: - - uses: JuliaRegistries/TagBot@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - ssh: ${{ secrets.DOCUMENTER_KEY }} +name: TagBot + +on: + issue_comment: + types: + - created + workflow_dispatch: + inputs: + lookback: + type: number + default: 3 + +permissions: + actions: read + checks: read + contents: write + deployments: read + issues: read + discussions: read + packages: read + pages: read + pull-requests: read + repository-projects: read + security-events: read + statuses: read + +jobs: + TagBot: + if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' + runs-on: ubuntu-latest + steps: + - uses: JuliaRegistries/TagBot@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + # Edit the following line to reflect the actual name of the GitHub Secret containing your private key + ssh: ${{ secrets.DOCUMENTER_KEY }} + # ssh: ${{ secrets.NAME_OF_MY_SSH_PRIVATE_KEY_SECRET }} diff --git a/.github/workflows/ci.yml b/.github/workflows/Test.yml similarity index 64% rename from .github/workflows/ci.yml rename to .github/workflows/Test.yml index 409e0d14..f9ecaee0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/Test.yml @@ -1,54 +1,79 @@ -name: CI -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] -jobs: - test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} - runs-on: ${{ matrix.os }} - continue-on-error: ${{ matrix.allow_failure }} - strategy: - fail-fast: false - matrix: - version: ['1.6', '1'] - os: [ubuntu-latest, macOS-latest, windows-latest] - arch: [x64] - allow_failure: [false] - include: - - version: 'nightly' - os: ubuntu-latest - arch: x64 - allow_failure: true - - version: 'nightly' - os: macOS-latest - arch: x64 - allow_failure: true - - version: 'nightly' - os: windows-latest - arch: x64 - allow_failure: true - steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 - with: - version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-runtest@v1 - - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v1 - with: - file: lcov.info +name: Test + +on: + push: + branches: + - main + paths: + - "src/**" + - "test/**" + - "*.toml" + tags: ["*"] + pull_request: + branches: + - main + paths: + - "src/**" + - "test/**" + - "*.toml" + types: [opened, synchronize, reopened] + +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - "1.6" + - "1" + - "nightly" + os: + - ubuntu-latest + - macOS-latest + - windows-latest + arch: + - x64 + allow_failure: [false] + include: + - version: "nightly" + os: ubuntu-latest + arch: x64 + allow_failure: true + - version: "nightly" + os: macOS-latest + arch: x64 + allow_failure: true + - version: "nightly" + os: windows-latest + arch: x64 + allow_failure: true + steps: + - uses: actions/checkout@v3 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: actions/cache@v1 + env: + cache-name: cache-artifacts + with: + path: ~/.julia/artifacts + key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} + restore-keys: | + ${{ runner.os }}-test-${{ env.cache-name }}- + ${{ runner.os }}-test- + ${{ runner.os }}- + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 + with: + file: lcov.info diff --git a/.github/workflows/format_pr.yml b/.github/workflows/format_pr.yml deleted file mode 100644 index c8f53089..00000000 --- a/.github/workflows/format_pr.yml +++ /dev/null @@ -1,32 +0,0 @@ -# https://github.com/julia-actions/julia-format/blob/master/workflows/format_pr.yml -name: format-pr -on: - push: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install JuliaFormatter and format - run: | - julia -e 'import Pkg; Pkg.add("JuliaFormatter")' - julia -e 'using JuliaFormatter; format(".")' - # https://github.com/marketplace/actions/create-pull-request - # https://github.com/peter-evans/create-pull-request#reference-example - - name: Create Pull Request - id: cpr - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: ":robot: Format .jl files" - title: '[AUTO] JuliaFormatter.jl run' - branch: auto-juliaformatter-pr - delete-branch: true - labels: formatting, automated pr, no changelog - - name: Check outputs - run: | - echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" - echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" \ No newline at end of file diff --git a/.gitignore b/.gitignore index ee3eb900..b19d550c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ -docs/build -docs/Manifest.toml -*/.DS_Store -.DS_Store +*.jl.*.cov +*.jl.cov +*.jl.mem Manifest.toml +docs/build/ +*.rej diff --git a/.markdown-link-config.json b/.markdown-link-config.json new file mode 100644 index 00000000..de14e9ec --- /dev/null +++ b/.markdown-link-config.json @@ -0,0 +1,7 @@ +{ + "ignorePatterns": [ + { + "pattern": "@ref" + } + ] +} diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 00000000..8bf958ad --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,13 @@ +{ + "MD007": { + "indent": 2, + "start_indented": false + }, + "MD013": { + "line_length": 1000, + "tables": false + }, + "MD033": false, + "MD041": false, + "default": true +} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..49f1c39c --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,55 @@ +repos: + - repo: local + hooks: + # Prevent committing .rej files + - id: forbidden-files + name: forbidden files + entry: found Copier update rejection files; review them and remove them + language: fail + files: "\\.rej$" + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-json + - id: check-toml + - id: check-yaml + - id: end-of-file-fixer + - id: file-contents-sorter + files: .JuliaFormatter.toml + args: [--unique] + - id: mixed-line-ending + args: [--fix=lf] + - id: no-commit-to-branch + - id: pretty-format-json + args: [--autofix, --indent=2] + - id: trailing-whitespace + - id: check-merge-conflict + args: [--assume-in-merge] + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.37.0 + hooks: + - id: markdownlint-fix + - repo: https://github.com/citation-file-format/cffconvert + rev: 054bda51dbe278b3e86f27c890e3f3ac877d616c + hooks: + - id: validate-cff + - repo: https://github.com/pre-commit/mirrors-prettier + rev: "v3.0.3" # Use the sha or tag you want to point at + hooks: + - id: prettier + types_or: [yaml, json] + exclude: ".copier-answers.yml" + - repo: https://github.com/adrienverge/yamllint + rev: v1.32.0 + hooks: + - id: yamllint + - repo: https://github.com/domluna/JuliaFormatter.jl + rev: v1.0.36 + hooks: + - id: julia-formatter + - repo: https://github.com/tcort/markdown-link-check + rev: v3.11.2 + hooks: + - id: markdown-link-check + args: + - --config=.markdown-link-config.json diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 00000000..5e16e5fb --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,2 @@ +rules: + indentation: { spaces: 2 } diff --git a/.zenodo.json b/.zenodo.json deleted file mode 100644 index 043a2e7b..00000000 --- a/.zenodo.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "description": "JuliaSmoothOptimizers optimization solvers", - "title": "JSOSolvers.jl", - "upload_type": "software", - "license": "MPL-2.0", - "creators": [ - { - "affiliation": "Federal University of Paraná - UFPR", - "name": "Abel Soares Siqueira" - }, - { - "affiliation": "École Polytechnique/GERAD - Montréal", - "name": "Dominique Orban" - } - ], - "access_right": "open", - "related_identifiers": [ - { - "scheme": "url", - "identifier": "https://github.com/JuliaSmoothOptimizers/JSOSolvers.jl/releases/latest", - "relation": "isSupplementTo" - } - ] -} diff --git a/CITATION.bib b/CITATION.bib deleted file mode 100644 index 15543be3..00000000 --- a/CITATION.bib +++ /dev/null @@ -1,8 +0,0 @@ -@Misc{orban-siqueira-jsosolvers-2021, - author = {D. Orban and A. S. Siqueira and {contributors}}, - title = {{JSOSolvers.jl}: {JuliaSmoothOptimizers} optimization solvers}, - month = {March}, - howpublished = {\url{https://github.com/JuliaSmoothOptimizers/JSOSolvers.jl}}, - year = {2021}, - DOI = {10.5281/zenodo.3991143}, -} diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 00000000..f6a8325d --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,38 @@ +# This CITATION.cff file was generated with cffinit. +# Visit https://bit.ly/cffinit to generate yours today! + +cff-version: 1.2.0 +title: JSOSolvers.jl +message: >- + If you use this software, please cite it using the + metadata from this file. +type: software +authors: + - affiliation: "Netherlands eScience Center, Amsterdam, NL" + orcid: "https://orcid.org/0000-0003-4451-281X" + email: abel.s.siqueira@gmail.com + given-names: Abel + family-names: Soares Siqueira + - given-names: Dominique + family-names: Orban + email: dominique.orban@gerad.ca + orcid: "https://orcid.org/0000-0002-8017-7687" + affiliation: >- + GERAD and Department of Mathematics and Industrial + Engineering, Polytechnique Montréal, QC, Canada + - given-names: Tangi + family-names: Migot + email: tangi.migot@gmail.com + affiliation: >- + GERAD and Department of Mathematics and Industrial + Engineering, Polytechnique Montréal, QC, Canada. + orcid: "https://orcid.org/0000-0001-7729-2513" +identifiers: + - type: doi + value: 10.5281/zenodo.3991143 + description: Zenodo concept DOI +repository-code: "https://github.com/JuliaSmoothOptimizers/JSOSolvers.jl" +keywords: + - optimization + - julia +license: MPL-2.0 diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..a612ad98 --- /dev/null +++ b/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index cdc98840..00000000 --- a/LICENSE.md +++ /dev/null @@ -1,379 +0,0 @@ -Copyright (c) 2019: Abel Soares Siqueira and Dominique Orban - -JSOSolvers.jl is licensed under the [MPL version 2.0](https://www.mozilla.org/MPL/2.0/). - -## License - - Mozilla Public License Version 2.0 - ================================== - - 1. Definitions - -------------- - - 1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - - 1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - - 1.3. "Contribution" - means Covered Software of a particular Contributor. - - 1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - - 1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - - 1.6. "Executable Form" - means any form of the work other than Source Code Form. - - 1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - - 1.8. "License" - means this document. - - 1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - - 1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - - 1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - - 1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - - 1.13. "Source Code Form" - means the form of the work preferred for making modifications. - - 1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - 2. License Grants and Conditions - -------------------------------- - - 2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - (a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - - (b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - - 2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution - become effective for each Contribution on the date the Contributor first - distributes such Contribution. - - 2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under - this License. No additional rights or licenses will be implied from the - distribution or licensing of Covered Software under this License. - Notwithstanding Section 2.1(b) above, no patent license is granted by a - Contributor: - - (a) for any code that a Contributor has removed from Covered Software; - or - - (b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - (c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - - This License does not grant any rights in the trademarks, service marks, - or logos of any Contributor (except as may be necessary to comply with - the notice requirements in Section 3.4). - - 2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this - License (see Section 10.2) or under the terms of a Secondary License (if - permitted under the terms of Section 3.3). - - 2.5. Representation - - Each Contributor represents that the Contributor believes its - Contributions are its original creation(s) or it has sufficient rights - to grant the rights to its Contributions conveyed by this License. - - 2.6. Fair Use - - This License is not intended to limit any rights You have under - applicable copyright doctrines of fair use, fair dealing, or other - equivalents. - - 2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted - in Section 2.1. - - 3. Responsibilities - ------------------- - - 3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under - the terms of this License. You must inform recipients that the Source - Code Form of the Covered Software is governed by the terms of this - License, and how they can obtain a copy of this License. You may not - attempt to alter or restrict the recipients' rights in the Source Code - Form. - - 3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - (a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - - (b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - - 3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for - the Covered Software. If the Larger Work is a combination of Covered - Software with a work governed by one or more Secondary Licenses, and the - Covered Software is not Incompatible With Secondary Licenses, this - License permits You to additionally distribute such Covered Software - under the terms of such Secondary License(s), so that the recipient of - the Larger Work may, at their option, further distribute the Covered - Software under the terms of either this License or such Secondary - License(s). - - 3.4. Notices - - You may not remove or alter the substance of any license notices - (including copyright notices, patent notices, disclaimers of warranty, - or limitations of liability) contained within the Source Code Form of - the Covered Software, except that You may alter any license notices to - the extent required to remedy known factual inaccuracies. - - 3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on - behalf of any Contributor. You must make it absolutely clear that any - such warranty, support, indemnity, or liability obligation is offered by - You alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - - 4. Inability to Comply Due to Statute or Regulation - --------------------------------------------------- - - If it is impossible for You to comply with any of the terms of this - License with respect to some or all of the Covered Software due to - statute, judicial order, or regulation then You must: (a) comply with - the terms of this License to the maximum extent possible; and (b) - describe the limitations and the code they affect. Such description must - be placed in a text file included with all distributions of the Covered - Software under this License. Except to the extent prohibited by statute - or regulation, such description must be sufficiently detailed for a - recipient of ordinary skill to be able to understand it. - - 5. Termination - -------------- - - 5.1. The rights granted under this License will terminate automatically - if You fail to comply with any of its terms. However, if You become - compliant, then the rights granted under this License from a particular - Contributor are reinstated (a) provisionally, unless and until such - Contributor explicitly and finally terminates Your grants, and (b) on an - ongoing basis, if such Contributor fails to notify You of the - non-compliance by some reasonable means prior to 60 days after You have - come back into compliance. Moreover, Your grants from a particular - Contributor are reinstated on an ongoing basis if such Contributor - notifies You of the non-compliance by some reasonable means, this is the - first time You have received notice of non-compliance with this License - from such Contributor, and You become compliant prior to 30 days after - Your receipt of the notice. - - 5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, - counter-claims, and cross-claims) alleging that a Contributor Version - directly or indirectly infringes any patent, then the rights granted to - You by any and all Contributors for the Covered Software under Section - 2.1 of this License shall terminate. - - 5.3. In the event of termination under Sections 5.1 or 5.2 above, all - end user license agreements (excluding distributors and resellers) which - have been validly granted by You or Your distributors under this License - prior to termination shall survive termination. - - ************************************************************************ - * * - * 6. Disclaimer of Warranty * - * ------------------------- * - * * - * Covered Software is provided under this License on an "as is" * - * basis, without warranty of any kind, either expressed, implied, or * - * statutory, including, without limitation, warranties that the * - * Covered Software is free of defects, merchantable, fit for a * - * particular purpose or non-infringing. The entire risk as to the * - * quality and performance of the Covered Software is with You. * - * Should any Covered Software prove defective in any respect, You * - * (not any Contributor) assume the cost of any necessary servicing, * - * repair, or correction. This disclaimer of warranty constitutes an * - * essential part of this License. No use of any Covered Software is * - * authorized under this License except under this disclaimer. * - * * - ************************************************************************ - - ************************************************************************ - * * - * 7. Limitation of Liability * - * -------------------------- * - * * - * Under no circumstances and under no legal theory, whether tort * - * (including negligence), contract, or otherwise, shall any * - * Contributor, or anyone who distributes Covered Software as * - * permitted above, be liable to You for any direct, indirect, * - * special, incidental, or consequential damages of any character * - * including, without limitation, damages for lost profits, loss of * - * goodwill, work stoppage, computer failure or malfunction, or any * - * and all other commercial damages or losses, even if such party * - * shall have been informed of the possibility of such damages. This * - * limitation of liability shall not apply to liability for death or * - * personal injury resulting from such party's negligence to the * - * extent applicable law prohibits such limitation. Some * - * jurisdictions do not allow the exclusion or limitation of * - * incidental or consequential damages, so this exclusion and * - * limitation may not apply to You. * - * * - ************************************************************************ - - 8. Litigation - ------------- - - Any litigation relating to this License may be brought only in the - courts of a jurisdiction where the defendant maintains its principal - place of business and such litigation shall be governed by laws of that - jurisdiction, without reference to its conflict-of-law provisions. - Nothing in this Section shall prevent a party's ability to bring - cross-claims or counter-claims. - - 9. Miscellaneous - ---------------- - - This License represents the complete agreement concerning the subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. Any law or regulation which provides - that the language of a contract shall be construed against the drafter - shall not be used to construe this License against a Contributor. - - 10. Versions of the License - --------------------------- - - 10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - - 10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version - of the License under which You originally received the Covered Software, - or under the terms of any subsequent version published by the license - steward. - - 10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a - modified version of this License if you rename the license and remove - any references to the name of the license steward (except to note that - such modified license differs from this License). - - 10.4. Distributing Source Code Form that is Incompatible With Secondary - Licenses - - If You choose to distribute Source Code Form that is Incompatible With - Secondary Licenses under the terms of this version of the License, the - notice described in Exhibit B of this License must be attached. - - Exhibit A - Source Code Form License Notice - ------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - - If it is not possible or desirable to put the notice in a particular - file, then You may include the notice in a location (such as a LICENSE - file in a relevant directory) where a recipient would be likely to look - for such a notice. - - You may add additional accurate notices of copyright ownership. - - Exhibit B - "Incompatible With Secondary Licenses" Notice - --------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. diff --git a/Project.toml b/Project.toml index f17bc7ca..acb98dfb 100644 --- a/Project.toml +++ b/Project.toml @@ -21,13 +21,3 @@ NLPModelsModifiers = "0.6" SolverCore = "0.3" SolverTools = "0.8" julia = "1.6" - -[extras] -ADNLPModels = "54578032-b7ea-4c30-94aa-7cbd1cce6c9a" -NLPModelsTest = "7998695d-6960-4d3a-85c4-e1bceb8cd856" -SolverTest = "4343dc35-3317-4c6e-8877-f0cc8502c90e" -SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[targets] -test = ["ADNLPModels", "NLPModelsTest", "SolverTest", "SparseArrays", "Test"] diff --git a/README.md b/README.md index d08d4e39..0f338b5b 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3991143.svg)](https://doi.org/10.5281/zenodo.3991143) [![GitHub release](https://img.shields.io/github/release/JuliaSmoothOptimizers/JSOSolvers.jl.svg)](https://github.com/JuliaSmoothOptimizers/JSOSolvers.jl/releases/latest) -[![](https://img.shields.io/badge/docs-stable-3f51b5.svg)](https://jso.dev/JSOSolvers.jl/stable) -[![](https://img.shields.io/badge/docs-latest-3f51b5.svg)](https://jso.dev/JSOSolvers.jl/latest) +[![Stable documentation](https://img.shields.io/badge/docs-stable-3f51b5.svg)](https://jso.dev/JSOSolvers.jl/stable) +[![Latest documentation](https://img.shields.io/badge/docs-latest-3f51b5.svg)](https://jso.dev/JSOSolvers.jl/latest) [![codecov](https://codecov.io/gh/JuliaSmoothOptimizers/JSOSolvers.jl/branch/main/graph/badge.svg?token=eyiGsilbZx)](https://codecov.io/gh/JuliaSmoothOptimizers/JSOSolvers.jl) ![CI](https://github.com/JuliaSmoothOptimizers/JSOSolvers.jl/workflows/CI/badge.svg?branch=main) @@ -12,21 +12,23 @@ This package provides optimization solvers curated by the JuliaSmoothOptimizers organization for unconstrained optimization - min f(x) +$$\min \ f(x)$$ and bound-constrained optimization - min f(x) s.t. ℓ ≤ x ≤ u +$$\min \ f(x) \ \text{subject to} \ ℓ ≤ x ≤ u.$$ This package provides an implementation of four classic algorithms for unconstrained/bound-constrained nonlinear optimization: + + - `lbfgs`: an implementation of a limited-memory BFGS line-search method for unconstrained minimization; - `R2`: a first-order quadratic regularization method for unconstrained optimization; - `tron`: a pure Julia implementation of TRON, a trust-region solver for bound-constrained optimization described in > Chih-Jen Lin and Jorge J. Moré, *Newton's Method for Large Bound-Constrained > Optimization Problems*, SIAM J. Optim., 9(4), 1100–1127, 1999. - > DOI: [10.1137/S1052623498345075](https://www.doi.org/10.1137/S1052623498345075) + > DOI: [10.1137/S1052623498345075](https://epubs.siam.org/doi/10.1137/S1052623498345075) as well as a variant for nonlinear least-squares; - `trunk`: a trust-region solver for unconstrained optimization using exact second derivatives. Our implementation follows the description given in @@ -34,10 +36,12 @@ This package provides an implementation of four classic algorithms for unconstra > A. R. Conn, N. I. M. Gould, and Ph. L. Toint, > Trust-Region Methods, volume 1 of MPS/SIAM Series on Optimization. > SIAM, Philadelphia, USA, 2000. - > DOI: [10.1137/1.9780898719857](https://www.doi.org/10.1137/1.9780898719857) + > DOI: [10.1137/1.9780898719857](https://epubs.siam.org/doi/book/10.1137/1.9780898719857) The package also contains a variant for nonlinear least-squares. + + ## Installation `pkg> add JSOSolvers` @@ -54,9 +58,9 @@ stats = lbfgs(nlp) # or trunk, tron, R2 ## How to cite -If you use JSOSolvers.jl in your work, please cite using the format given in [CITATION.bib](CITATION.bib). +If you use JSOSolvers.jl in your work, please cite using the format given in (CITATION.cff). -# Bug reports and discussions +## Bug reports and discussions If you think you found a bug, feel free to open an [issue](https://github.com/JuliaSmoothOptimizers/JSOSolvers.jl/issues). Focused suggestions and requests can also be opened as issues. Before opening a pull request, start an issue or a discussion on the topic, please. diff --git a/docs/make.jl b/docs/make.jl index ee7b4b7a..26bed02d 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,19 +1,28 @@ -using Documenter, JSOSolvers +using JSOSolvers +using Documenter -makedocs( +DocMeta.setdocmeta!(JSOSolvers, :DocTestSetup, :(using JSOSolvers); recursive = true) + +makedocs(; modules = [JSOSolvers], doctest = true, linkcheck = true, - format = Documenter.HTML( - prettyurls = get(ENV, "CI", nothing) == "true", + authors = "Abel Soares Siqueira and contributors", + repo = "https://github.com/JuliaSmoothOptimizers/JSOSolvers.jl/blob/{commit}{path}#{line}", + sitename = "JSOSolvers.jl", + format = Documenter.HTML(; + prettyurls = get(ENV, "CI", "false") == "true", + canonical = "https://JuliaSmoothOptimizers.github.io/JSOSolvers.jl", assets = ["assets/style.css"], ), - sitename = "JSOSolvers.jl", - pages = ["index.md", "solvers.md", "internal.md", "reference.md"], + pages = [ + "index.md", + "solvers.md", + "internal.md", + "contributing.md", + "developer.md", + "reference.md", + ], ) -deploydocs( - repo = "github.com/JuliaSmoothOptimizers/JSOSolvers.jl.git", - push_preview = true, - devbranch = "main", -) +deploydocs(; repo = "github.com/JuliaSmoothOptimizers/JSOSolvers.jl", push_preview = true) diff --git a/docs/src/contributing.md b/docs/src/contributing.md new file mode 100644 index 00000000..81d45a4c --- /dev/null +++ b/docs/src/contributing.md @@ -0,0 +1,26 @@ +# Contributing guidelines + +First of all, thanks for the interest! + +We welcome all kinds of contribution, including, but not limited to code, documentation, examples, configuration, issue creating, etc. + +Be polite and respectful. + +## Bug reports and discussions + +If you think you found a bug, feel free to open an [issue](https://github.com/JuliaSmoothOptimizers/JSOSolvers.jl/issues). +Focused suggestions and requests can also be opened as issues. +Before opening a pull request, start an issue or a discussion on the topic, please. + +## Working on an issue + +If you found an issue that interests you, comment on that issue what your plans are. +If the solution to the issue is clear, you can immediately create a pull request (see below). +Otherwise, say what your proposed solution is and wait for a discussion around it. + +> **tip** +> +> Feel free to ping us after a few days if there are no responses. + +If your solution involves code (or something that requires running the package locally), check the [developer documentation](developer.md). +Otherwise, you can use the GitHub interface directly to create your pull request. diff --git a/docs/src/developer.md b/docs/src/developer.md new file mode 100644 index 00000000..66232ccd --- /dev/null +++ b/docs/src/developer.md @@ -0,0 +1,89 @@ +# Developer documentation + +If you haven't, please read the [Contributing guidelindes](contributing.md) first. + +## Linting and formatting + +Install a plugin on your editor to use [EditorConfig](https://editorconfig.org). +This will ensure that your editor is configured with important formatting settings. + +We use [https://pre-commit.com](https://pre-commit.com) to run the linters and formatters. +In particular, the Julia code is formatted using [JuliaFormatter.jl](https://github.com/domluna/JuliaFormatter.jl), so please install it globally first. + +Install `pre-commit` (we recommend using [pipx](https://pypa.github.io/pipx/)): + +```bash +# Install pipx following the link +pipx install pre-commit +``` + +With `pre-commit` installed, activate it as a pre-commit hook: + +```bash +pre-commit install +``` + +To run the linting and formatting manually, enter the command below: + +```bash +pre-commit run -a +``` + +**Now, you can only commit if all the pre-commit tests pass**. + +## First time clone + +1. Fork this repo +2. Clone your repo (this will create a `git remote` called `origin`) +3. Add this repo as a remote `git remote add orgremote https://github.com/JuliaSmoothOptimizers/JSOSolvers.jl` + +## Working on a new issue + +1. Fetch from the JSO remote and fast-forward your local main + + ```bash + git fetch orgremote + git switch main + git merge --ff-only orgremote/main + ``` + +2. Branch from `main` to address the issue (see below for naming) + + ```bash + git switch -c 42-add-answer-universe + ``` + +3. Push the new local branch to your personal remote repository + + ```bash + git push -u origin 42-add-answer-universe + ``` + +4. Create a pull request to merge your remote branch into the org main. + +### Branch naming + +- If there is an associated issue, add the issue number. +- If there is no associated issue, **and the changes are small**, add a prefix such as "typo", "hotfix", "small-refactor", according to the type of update. +- If the changes are not small and there is no associated issue, then create the issue first, so we can properly discuss the changes. +- Use dash separated imperative wording related to the issue (e.g., `14-add-tests`, `15-fix-model`, `16-remove-obsolete-files`). + +### Commit message + +- Use imperative, present tense (Add feature, Fix bug) +- Have informative titles +- If necessary, add a body with details + +### Before creating a pull request + +- [Advanced] Try to create "atomic git commits" (recommended reading: [The Utopic Git History](https://blog.esciencecenter.nl/the-utopic-git-history-d44b81c09593)). +- Make sure the tests pass. +- Make sure the pre-commit tests pass. +- Fetch any `main` updates from upstream and rebase your branch, if necessary: + + ```bash + git fetch orgremote + git rebase orgremote/main BRANCH_NAME + ``` + +- Then you can open a pull request and work with the reviewer to address any issues diff --git a/docs/src/solvers.md b/docs/src/solvers.md index 06fe0eed..c88387aa 100644 --- a/docs/src/solvers.md +++ b/docs/src/solvers.md @@ -1,12 +1,14 @@ # Solvers -**Solver list** +Here is the list of solvers in this package: - [`lbfgs`](@ref) - [`tron`](@ref) - [`trunk`](@ref) - [`R2`](@ref) +Here it is in table format: + | Problem type | Solvers | | --------------------- | -------- | | Unconstrained NLP | [`lbfgs`](@ref), [`tron`](@ref), [`trunk`](@ref), [`R2`](@ref)| diff --git a/src/R2.jl b/src/R2.jl index 79b7d7c0..70df8e33 100644 --- a/src/R2.jl +++ b/src/R2.jl @@ -13,7 +13,7 @@ For advanced usage, first define a `R2Solver` to preallocate the memory used in # Arguments - `nlp::AbstractNLPModel{T, V}` is the model to solve, see `NLPModels.jl`. -# Keyword arguments +# Keyword arguments - `x::V = nlp.meta.x0`: the initial guess. - `atol::T = √eps(T)`: absolute tolerance. - `rtol::T = √eps(T)`: relative tolerance: algorithm stops when ‖∇f(xᵏ)‖ ≤ atol + rtol * ‖∇f(x⁰)‖. @@ -80,7 +80,7 @@ function R2Solver(nlp::AbstractNLPModel{T, V}) where {T, V} gx = similar(nlp.meta.x0) cx = similar(nlp.meta.x0) d = fill!(similar(nlp.meta.x0), 0) - σ = zero(T) # init it to zero for now + σ = zero(T) # init it to zero for now return R2Solver{T, V}(x, gx, cx, d, σ) end @@ -134,7 +134,7 @@ function SolverCore.solve!( set_dual_residual!(stats, norm_∇fk) σk = 2^round(log2(norm_∇fk + 1)) - # Stopping criterion: + # Stopping criterion: ϵ = atol + rtol * norm_∇fk optimal = norm_∇fk ≤ ϵ if optimal diff --git a/src/tron.jl b/src/tron.jl index 4026f9b7..f556290d 100644 --- a/src/tron.jl +++ b/src/tron.jl @@ -9,9 +9,9 @@ tron(nlp::AbstractNLPModel; variant = :Newton, kwargs...) = tron(Val(variant), n tron(nlp; kwargs...) A pure Julia implementation of a trust-region solver for bound-constrained optimization: - + min f(x) s.t. ℓ ≦ x ≦ u - + For advanced usage, first define a `TronSolver` to preallocate the memory used in the algorithm, and then call `solve!`: solver = TronSolver(nlp; kwargs...) diff --git a/test/Project.toml b/test/Project.toml new file mode 100644 index 00000000..b0392f72 --- /dev/null +++ b/test/Project.toml @@ -0,0 +1,15 @@ +[deps] +ADNLPModels = "54578032-b7ea-4c30-94aa-7cbd1cce6c9a" +Krylov = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7" +LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +LinearOperators = "5c8ed15e-5a4c-59e4-a42b-c7e8811fb125" +Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" +NLPModels = "a4795742-8479-5a88-8948-cc11e1c8c1a6" +NLPModelsModifiers = "e01155f1-5c6f-4375-a9d8-616dd036575f" +NLPModelsTest = "7998695d-6960-4d3a-85c4-e1bceb8cd856" +Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" +SolverCore = "ff4d7338-4cf1-434d-91df-b86cb86fb843" +SolverTest = "4343dc35-3317-4c6e-8877-f0cc8502c90e" +SolverTools = "b5612192-2639-5dc1-abfe-fbedd65fab29" +SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"