diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..32141bb --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,60 @@ +name: CI +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: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1.10' + - '1.11' + os: + - ubuntu-latest + arch: + - x64 + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: julia-actions/cache@v1 + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 + continue-on-error: ${{ matrix.version == 'nightly' }} + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v5 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + docs: + name: Documentation + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: '1' + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-docdeploy@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: | + julia --project=docs -e ' + using Documenter: DocMeta, doctest + using Fides + DocMeta.setdocmeta!(Fides, :DocTestSetup, :(using Fides); recursive=true) + doctest(Fides)' diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml new file mode 100644 index 0000000..3dfba52 --- /dev/null +++ b/.github/workflows/CompatHelper.yml @@ -0,0 +1,45 @@ +name: CompatHelper +on: + schedule: + - cron: 0 0 * * * + workflow_dispatch: +permissions: + contents: write + pull-requests: write +jobs: + CompatHelper: + runs-on: ubuntu-latest + steps: + - 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' + 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 }} + COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} + # COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} \ No newline at end of file diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml new file mode 100644 index 0000000..0b092a8 --- /dev/null +++ b/.github/workflows/FormatCheck.yml @@ -0,0 +1,48 @@ +name: format-check + +on: + push: + branches: + - 'main' + - 'release-' + tags: '*' + pull_request: + +concurrency: + # Skip intermediate builds: always, but for the master branch and tags. + # Cancel intermediate builds: always, but for the master branch and tags. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' && github.refs != 'refs/tags/*'}} + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + julia-version: [1] + julia-arch: [x86] + os: [ubuntu-latest] + steps: + - uses: julia-actions/setup-julia@latest + with: + version: ${{ matrix.julia-version }} + + - uses: actions/checkout@v4 + - name: Install JuliaFormatter and format + # This will use the latest version by default but you can set the version like so: + # + # julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))' + run: | + julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))' + julia -e 'using JuliaFormatter; format(".", verbose=true)' + - name: Format check + run: | + julia -e ' + out = Cmd(`git diff`) |> read |> String + if out == "" + exit(0) + else + @error "Some files have not been formatted !!!" + write(stdout, out) + exit(1) + end' \ No newline at end of file diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml new file mode 100644 index 0000000..3042569 --- /dev/null +++ b/.github/workflows/TagBot.yml @@ -0,0 +1,33 @@ +name: TagBot +on: + issue_comment: + types: + - created + workflow_dispatch: + inputs: + lookback: + 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 }} \ No newline at end of file diff --git a/Project.toml b/Project.toml index 594e2f7..fa4277f 100644 --- a/Project.toml +++ b/Project.toml @@ -15,11 +15,11 @@ Aqua = "0.8" ComponentArrays = "0.15" CondaPkg = "0.2" ForwardDiff = "0.10" -Printf = "1.11.0" +Printf = "1" PythonCall = "0.9" SafeTestsets = "0.1" SimpleUnPack = "1" -StyledStrings = "1.11.0" +StyledStrings = "1" Test = "1" julia = "1.10" diff --git a/README.md b/README.md index 5092c5f..e0544c9 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Fides.jl -[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://sebapersson.github.io/Fides.jl/stable/) -[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://sebapersson.github.io/Fides.jl/dev/) -[![Build Status](https://github.com/sebapersson/Fides.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/sebapersson/Fides.jl/actions/workflows/CI.yml?query=branch%3Amain) +[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://fides-dev.github.io/Fides.jl/stable/) +[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://fides-dev.github.io/Fides.jl/dev/) +[![Build Status](https://github.com/fides-dev/Fides.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/fides-dev/Fides.jl/actions/workflows/CI.yml?query=branch%3Amain) [![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl) -[![codecov](https://codecov.io/gh/sebapersson/Fides.jl/graph/badge.svg?token=J7PXRF30JG)](https://codecov.io/gh/sebapersson/Fides.jl) +[![codecov](https://codecov.io/gh/fides-dev/Fides.jl/graph/badge.svg?token=J7PXRF30JG)](https://codecov.io/gh/fides-dev/Fides.jl) [![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle) Fides.jl is a Julia wrapper of the Python package [Fides.py](https://github.com/fides-dev/fides), which implements an Interior Trust Region Reflective for bounds constrained optimization problems based on [1, 2]. Fides targets problems on the form: diff --git a/docs/make.jl b/docs/make.jl index 220acc1..f4d5cd9 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -5,11 +5,11 @@ DocMeta.setdocmeta!(Fides, :DocTestSetup, :(using Fides); recursive = true) format = Documenter.HTML(;prettyurls = get(ENV, "CI", "false") == "true", assets = String["assets/custom_theme.css"], - repolink = "https://github.com/sebapersson/Fides.jl", + repolink = "https://github.com/fides-dev/Fides.jl", edit_link = "main") makedocs(; modules = [Fides], - repo = "https://github.com/sebapersson/Fides.jl/blob/{commit}{path}#{line}", + repo = "https://github.com/fides-dev/Fides.jl/blob/{commit}{path}#{line}", checkdocs = :exports, warnonly = false, format = format, @@ -20,5 +20,5 @@ makedocs(; modules = [Fides], "API" => "API.md", ],) -deploydocs(; repo = "github.com/sebapersson/Fides.jl.git", +deploydocs(; repo = "github.com/fides-dev/Fides.jl.git", devbranch = "main",) diff --git a/docs/src/index.md b/docs/src/index.md index ffd1496..4c0024e 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -17,7 +17,7 @@ Where `f` is a continues at least twice-differentaible function, and `lb` and `u - Good performance for parameter estimating Ordinary Differential Equation models [3]. !!! note "Star us on GitHub!" - If you find the package useful in your work please consider giving us a star on [GitHub](https://github.com/sebapersson/Fides.jl). This will help us secure funding in the future to continue maintaining the package. + If you find the package useful in your work please consider giving us a star on [GitHub](https://github.com/fides-dev/Fides.jl). This will help us secure funding in the future to continue maintaining the package. ## Installation @@ -41,7 +41,7 @@ If you have any problems using Fides, here are some helpful tips: - Check the Fides Python [documentation](https://fides-optimizer.readthedocs.io/en/latest/about.html). - Post your questions in the `#sciml-sysbio` or `#math-optimization` channel on the [Julia Slack](https://julialang.org/slack/). -- If you have encountered unexpected behavior or a bug, please open an issue on [GitHub](https://github.com/sebapersson/Fides.jl). +- If you have encountered unexpected behavior or a bug, please open an issue on [GitHub](https://github.com/fides-dev/Fides.jl). ## Citation diff --git a/test/show.jl b/test/show.jl index 9b89ac5..1558aa0 100644 --- a/test/show.jl +++ b/test/show.jl @@ -8,5 +8,6 @@ sol = solve(prob, Fides.BFGS()) @testset "show" begin @test @sprintf("%s", prob) == "FidesProblem with 2 parameters to estimate" - @test @sprintf("%s", sol)[1:140] == "FidesSolution\n---------------- Summary ---------------\nmin(f) = 3.30e-14\nParameters estimated = 2\nOptimiser iterations = 46" + @test @sprintf("%s", sol)[1:140] == + "FidesSolution\n---------------- Summary ---------------\nmin(f) = 3.30e-14\nParameters estimated = 2\nOptimiser iterations = 46" end