diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 40f23173..9463fb9e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,6 +6,6 @@ version: 2 updates: - package-ecosystem: "cargo" - directory: "/" + directory: "/rust" schedule: interval: "weekly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7afc917a..add1e2be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,10 +36,12 @@ jobs: rustflags: "" - name: Cargo tests + working-directory: rust run: cargo test - name: Cargo tests (RP and JEM) if: runner.os != 'Windows' + working-directory: rust run: | cargo test --features rp cargo test --features jem @@ -79,7 +81,7 @@ jobs: with: python-version: "3.12" cache: "pip" - cache-dependency-path: open-codegen/pyproject.toml + cache-dependency-path: python/pyproject.toml - uses: egor-tensin/setup-clang@v1 if: runner.os == 'Linux' @@ -111,17 +113,17 @@ jobs: - name: Install Python package if: runner.os == 'Windows' - working-directory: open-codegen run: | + Set-Location python python -m pip install --upgrade pip python -m pip install . - name: Run Python test.py if: runner.os == 'Windows' - working-directory: open-codegen - env: - PYTHONPATH: . - run: python -W ignore test/test.py -v + run: | + Set-Location python + $env:PYTHONPATH = "." + python -W ignore test/test.py -v ros2_tests: name: ROS2 tests @@ -201,7 +203,7 @@ jobs: with: python-version: "3.12" cache: "pip" - cache-dependency-path: open-codegen/pyproject.toml + cache-dependency-path: python/pyproject.toml - name: Run OCP Python tests if: runner.os != 'Windows' @@ -209,14 +211,14 @@ jobs: - name: Install Python package if: runner.os == 'Windows' - working-directory: open-codegen run: | + Set-Location python python -m pip install --upgrade pip python -m pip install . - name: Run OCP Python tests if: runner.os == 'Windows' - working-directory: open-codegen - env: - PYTHONPATH: . - run: python -W ignore test/test_ocp.py -v + run: | + Set-Location python + $env:PYTHONPATH = "." + python -W ignore test/test_ocp.py -v diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index aa1efe3d..594af46e 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -8,14 +8,11 @@ jobs: clippy_check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v5 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - profile: minimal toolchain: stable - override: true components: clippy - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --examples + - name: Cargo clippy + working-directory: rust + run: cargo clippy --all-targets --all-features --examples diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml index 102f0e3d..aa7e8c7c 100644 --- a/.github/workflows/rustfmt.yml +++ b/.github/workflows/rustfmt.yml @@ -10,14 +10,11 @@ jobs: name: Rustfmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v5 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - profile: minimal toolchain: stable - override: true components: rustfmt - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + - name: Cargo fmt + working-directory: rust + run: cargo fmt --all -- --check diff --git a/.gitignore b/.gitignore index 19ddedec..67b5085e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,77 +1,48 @@ -# Generated by Cargo -# will have compiled files and executables -.eggs -.idea -TODOS/ +# Rust +.cargo /target target/ -.cargo -*.odp# -*.egg-info -*.pyc -open-codegen/opengen/icasadi/extern/Makefile -virt -data -my_optimizers -.python_test_build -dist/ - -# Python tests create this folder: -open-codegen/opengen/.python_test_build/ - -# Haphazard files: -__main.rs -design/open-card.odp -design/open-interfaces.jpeg -design/open-interfaces.odp -design/open-interfaces.png -main.rs -open-codegen/run/ -open-codegen/venv* - - -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -/Cargo.lock +/rust/Cargo.lock open-clib/Cargo.lock - -# These are backup files generated by rustfmt *.rs.bk -# Docusaurus website (autogenerated files) -/website/i18n/ -/website/node_modules/ -/website/yarn.lock -/website/build/ -/website/.docusaurus/ -!/website/pages/ -!/website/static/ -!/website/*.js -!/website/blog/ -!/website/core/Footer.js -!/website/README.md -!/website/publish.sh +# Python +virt -# icasadi external files -/icasadi/extern/ +# Docs / website +/docs/website/i18n/ +/docs/website/node_modules/ +/docs/website/yarn.lock +/docs/website/build/ +/docs/website/.docusaurus/ -# Visual studio code files +# Editors / local state +.idea /.vscode/ +.DS_Store -# Main file -/src/main.rs - -# Autogenerated files (builds) +# Project-local scratch files +TODOS/ +data +*.odp# +__main.rs +main.rs +/rust/src/main.rs /autogenerated_* /build/ !/build/README.md -# Other files +# Design assets that should stay local +design/open-card.odp +design/open-interfaces.jpeg +design/open-interfaces.odp +design/open-interfaces.png /design/panoc-only.png + +# Misc temporary files *.autosave *~ .#* -*private* -.DS_Store -/img/ + +# Private work area private/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c09ca90..fc2b5290 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,392 +1,61 @@ -# Change Log +# Changelog -All notable changes to this project will be documented in this file. +This file is the project-wide changelog for **Optimization Engine (OpEn)**. -The format is based on [Keep a Changelog](http://keepachangelog.com/) -and this project adheres to [Semantic Versioning](http://semver.org/). +It serves as the entrypoint for releases across the repository and points to the +component-specific changelogs, where the detailed changes for each module are +recorded. -Note: This is the main Changelog file for the Rust solver. The Changelog file for the Python interface (`opengen`) can be found in [/open-codegen/CHANGELOG.md](open-codegen/CHANGELOG.md) +## Component Changelogs +- [Rust library changelog](rust/CHANGELOG.md) +- [Python interface (`opengen`) changelog](python/CHANGELOG.md) +- [MATLAB interface changelog](matlab/CHANGELOG.md) +- [Docker image changelog](docker/CHANGELOG.md) - -## [v0.12.0] - Unreleased +## How To Read This Changelog -### Added +- Use this file for a high-level overview of changes across the whole project. +- Use the component changelogs above for detailed release notes, migration + notes, and module-specific fixes. +- Not every repository change appears here. Day-to-day implementation details + usually live only in the relevant component changelog. -- Richer Rust-side solver errors with human-readable reasons for projection failures, non-finite computations, linear algebra failures, and invalid internal solver states -- Fallible constraint projections via `Constraint::project(...) -> FunctionCallResult`, with error propagation through FBS, PANOC, and ALM -- Checked affine-space construction through `AffineSpace::try_new(...)` and `AffineSpaceError` +## Versioning Notes -### Changed +OpEn is a multi-component project, and not every part evolves on the same +version number or schedule. -- Rust solver supports generic float types -- Expanded Rust constraint and solver test coverage with constructor validation, boundary/idempotence checks, additional `BallP` / epigraph projection cases, and broader `f32`/`f64` coverage -- Swapped the cross-platform timer dependency to `web-time`, removed the old `instant`-specific wasm feature wiring, and updated optimizer timing call sites to use `web_time::Instant` -- Improved Rust-side error handling across constraints and core solvers so projection failures and invalid numerical states are reported explicitly instead of being silently flattened -- Refined `BallP`, `EpigraphSquaredNorm`, and related constraint implementations and docs for stronger numerical robustness and clearer behavior +- The Rust solver has its own release history in `rust/CHANGELOG.md`. +- The Python package `opengen` has its own release history in + `python/CHANGELOG.md`. +- The MATLAB interface and Docker image also track their changes separately. - -## [v0.11.1] - 2026-03-23 +When a release affects multiple parts of the repository, this root changelog can +be used to summarize the release and point readers to the detailed component +entries. +## Current Development Snapshot -### Fixed +At the time of writing, the main ongoing release tracks include: -- Return best PANOC half-step on early exit (issue #325) +- Rust library: `0.12.0` +- Python interface (`opengen`): `0.11.0` +- MATLAB interface: `0.1.0` +- Docker image: `0.7.0` +Please consult the linked component changelogs for the exact release state of +each module. - -## [v0.11.0] - 2026-03-14 +## Repository Layout -### Added +The main components live in: -- Implementation of `BallP` in Rust: projection on lp-ball +- [rust/](rust/) +- [python/](python/) +- [matlab/](matlab/) +- [docker/](docker/) +- [docs/](docs/) -### Changed - -- Algorithmic improvements in `EpigraphSquaredNorm` (numerically stable Newton refinement) and more detailed docs -- Assertion in `Ball1`, `Ball2`, and `BallInf` to check that that dimensions of `x` and `xc` are compatible (with unit test) -- Added validation in `Rectangle` and `Hyperplane` for invalid constructor inputs and strengthened dimension checks in hyperplane projection -- Added validation in `Sphere2` for empty inputs and incompatible center dimensions -- Added validation in `FiniteSet` for incompatible projection dimensions and corrected convexity detection for singleton sets -- Added unit tests for invalid `Rectangle`, `Simplex`, `Hyperplane`, `Sphere2`, and `FiniteSet` edge cases - -### Fixed - -- Typos and doctest annotations in docs of `CartesianProduct` (in Rust), `Rectangle`, and `Hyperplane`, with more detailed documentation - - - -## [v0.10.0] - 2026-03-10 - -### Added - -- Custom implementation of Cholesky factorisation (and solver); this is used in `AffineSpace` now. -- New function in `matrix_operations` to compute AA' given a matrix A - -### Changed - -- Update version of `ndarray`, in `Cargo.toml` -- Removed `modcholesky` because it was causing a bug (see issue #378) - - -## [v0.9.1] - 2024-08-14 - - -### Fixed - -- Order of dependencies in `Cargo.toml` fixes crate-not-found issue on Windows - - - - -## [v0.9.0] - 2024-03-20 - -### Added - -- Rust implementation of epigraph of squared Euclidean norm (constraint) -- Implementation of `AffineSpace` - -### Fixed - -- Clippy fixes - - -## [v0.8.1] - 2023-10-27 - -### Fixed - -- Fix bug in implementation of `ball2.rs` (radius was being ignored for balls centered not at the origin) - - - - -## [v0.8.1] - 2023-10-27 - -### Added - -- New constraint: sphere of Euclidean norm - - -## [v0.7.7] - 2023-01-17 - -### Fixed - -- Change `time::Instant` to `instant::Instant` to support WASM - - - - -## [v0.7.6] - 2022-10-11 - -### Added - -- Update functions in `AlmOptimizerStatus` - - - - - -## [v0.7.5] - 2022-06-22 - -### Fixed - -- Fixed estimation of initial Lipschitz constant, `L`, when it is close to or equal to zero (e.g., Huber loss function) -- Fixed issue in `AlmFactory` related to (F2) penalty constraints - - - -## [v0.7.4] - 2021-11-15 - -### Added - -- Optional feature `wasm` in `Cargo.toml` (WebAssembly support); see https://alphaville.github.io/optimization-engine/docs/openrust-features for details -- Using `instant::Instant` instead of `std::Instant` (Wasm-compatible) -- Fixed Rust documentation of `Ball1` - - -## [v0.7.3] - 2021-11-1 - -### Added - -* Implementation of Simplex and Ball1 constraints in Rust -* Fix issue with simultaneous use of features `jem` and `rp` - - - -## [v0.7.2] - 2021-10-27 - -### Changed - -* Removed unnecessary `#[no_mangle]` annotations -* Took care of additional clippy warnings -* Bump versions: `cbindgen`: `0.8 --> 0.20` and `libc`: `0.2.0 -> 0.2.*` - -### Added - -* Support for [`rpmalloc`](https://github.com/EmbarkStudios/rpmalloc-rs) and [`jemalloc`](https://github.com/gnzlbg/jemallocator) using the features `jem` and `rp` - - - - - -## [v0.7.1] - 2020-09-04 - -### Added - -* Introduced `Halfspace` (implemented and tested) -* Introduced `Hyperplane` (implemented and tested) -* New types: `FunctionCallResult`, `MappingType` and `JacobianMappingType` -* Various clippy-related code improvements - - - -## [v0.7.0] - 2020-05-04 - - -### Added - -* ALM: compute cost value at solution - - - - -## [v0.6.2] - 2019-10-29 - -### Fixed - -* Bug in codegen for Cartesian products (PR #147) -* Removed the use of `Default` in Rust (does not work for large slices) -* Python: fixed typo in method `with_lfbgs_memory` - -### Added - -* New support for C-to-Rust interface via bindgen -* Generation of example C code for C-to-Rust interface -* CMakeLists for auto-generated example in C -* Additional Python examples on web page -* Chat button in web page (for gitter) -* Added option `local_path` in `with_open_version` - -### Changed - -* Homotopy module in Rust is annotated as deprecated -* TCP server response is cast into Python objects (PR #144) -* Auto-generated code links to most recent crate, unless overriden -* Changed `jacobian` to `gradient` in Python - -## [v0.6.1-alpha.2] - 2019-09-7 - -### Fixed - -* TCP server: Malformed error JSON is now fixed -* Algorithm now returns `u_bar`, which is feasible (not `u`) - -### Added - -* Introduced C interface to CasADi-generated C functions -* Rust and Python implementations of joint ALM/PM algorithms -* Rust docs for augmented Lagrangian method (ALM) -* Release of crate version `0.6.1-alpha.1` and `0.6.1-alpha.2` -* Introduced `#![allow(dead_code)]` in ALM implementation -* New AKKT-compliant termination criterion -* Tolerance relaxation in penalty method -* Finite sets supported in Rust -* Rust/Python: setting CBFGS parameters -* Second-order cones supported in Rust -* Rust docs: support for equations with KaTeX - -### Changed - -* Updated README - - -### Removed - -* Support for Python <3.6 (deprecated) -* Module `continuation` is going to become obsolete - - -## [v0.5.0] - 2019-06-22 - -### Fixed - -* Fixed `with_max_duration` in `PANOC` not following the builder pattern -* Fixed misplaced `.unwrap()` in the `HomotopyOptimizer` -* Fixed so the Python builder uses the current directory as default - -### Added - -* Generation of C/C++ bindings added in the Python interface and included in the test suite -* Support in Rust for Cartesian product of constraints - -### Removed - -* Deprecated: `enable_tcp_interface` and `enable_c_bindings_generation` - - - -## [v0.4.0] - 2019-06-03 - -### Fixed - -* Windows interoperability of `matlab_open_root()` [closes #24] -* Issues with file separator on Windows [#26 and #27] -* Handling corner cases such as wrong input parameters -* Rust: checking for `NaN` and `Inf` values in solution - -### Added - -* New Python interface for code generation (works with Python 2.7, 3.4 and 3.6) -* Homotopy method implemented in Rust -* TCP interface in Rust is generated automatically on request -* Support for OSX and linux distros on [travis] [closes #25] -* Continuous integration on [Appveyor] -* Experimental C bindings library -* Documentation for new Rust code and Python code -* Unit tests in Python using `unittest` - -### Changed - -* Rust API: Using `Option<>` and `Result<>` to handle errors -* Updated L-BFGS dependency; now using version `0.2` (no NonZeroUsize) - - -## [v0.3.1] - 2019-05-21 - -### Fixed - -* An error in the Matlab codegen which made it inoperable - -### Added - -* Support for compiling for different targets - - - -## [v0.3.0] - 2019-05-16 - -This is a breaking API change. - -### Fixed - -* A lot of internal fixes and clean up -* `PANOCEngine` and `FBSEngine` is no longer explicitly needed -* Simplified import system -* Cost functions now need to return a `Result<(), Error>` to indicate if the evaluation was successful - -### Added - -* Started an `examples` folder - - - - -[v0.11.1]: https://github.com/alphaville/optimization-engine/compare/v0.11.0...v0.11.1 -[v0.11.0]: https://github.com/alphaville/optimization-engine/compare/v0.10.0...v0.11.0 -[v0.10.0]: https://github.com/alphaville/optimization-engine/compare/v0.9.1...v0.10.0 -[v0.9.1]: https://github.com/alphaville/optimization-engine/compare/v0.9.0...v0.9.1 -[v0.9.0]: https://github.com/alphaville/optimization-engine/compare/v0.8.1...v0.9.0 -[v0.8.1]: https://github.com/alphaville/optimization-engine/compare/v0.8.0...v0.8.1 -[v0.8.0]: https://github.com/alphaville/optimization-engine/compare/v0.7.7...v0.8.0 -[v0.7.7]: https://github.com/alphaville/optimization-engine/compare/v0.7.6...v0.7.7 -[v0.7.6]: https://github.com/alphaville/optimization-engine/compare/v0.7.5...v0.7.6 -[v0.7.5]: https://github.com/alphaville/optimization-engine/compare/v0.7.4...v0.7.5 -[v0.7.4]: https://github.com/alphaville/optimization-engine/compare/v0.7.3...v0.7.4 -[v0.7.3]: https://github.com/alphaville/optimization-engine/compare/v0.7.2...v0.7.3 -[v0.7.2]: https://github.com/alphaville/optimization-engine/compare/v0.7.1...v0.7.2 -[v0.7.1]: https://github.com/alphaville/optimization-engine/compare/v0.7.0...v0.7.1 -[v0.7.0]: https://github.com/alphaville/optimization-engine/compare/v0.6.2...v0.7.0 -[v0.6.2]: https://github.com/alphaville/optimization-engine/compare/v0.6.1-alpha.2...v0.6.2 -[v0.6.1-alpha.2]: https://github.com/alphaville/optimization-engine/compare/v0.5.0...v0.6.1-alpha.2 -[v0.5.0]: https://github.com/alphaville/optimization-engine/compare/v0.4.0...v0.5.0 -[v0.4.0]: https://github.com/alphaville/optimization-engine/compare/v0.3.1...v0.4.0 -[v0.3.1]: https://github.com/alphaville/optimization-engine/compare/v0.3.0...v0.3.1 -[v0.3.0]: https://github.com/alphaville/optimization-engine/compare/v0.2.2...v0.3.0 - - -[closes #24]: https://github.com/alphaville/optimization-engine/issues/24 -[closes #25]: https://github.com/alphaville/optimization-engine/issues/25 - - -[travis]: https://travis-ci.org/alphaville/optimization-engine/builds/537155440 -[Appveyor]: https://ci.appveyor.com/project/alphaville/optimization-engine +This changelog is intentionally lightweight so it can remain a stable landing +page even as individual components evolve independently. diff --git a/README.md b/README.md index d4f5bb43..1cb95b5d 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ OpEn allows application developers and researchers to focus on the challenges of ### Embedded applications OpEn can run on embedded devices; here we see it running on an intel Atom for the autonomous navigation of a lab-scale micro aerial vehicle - the controller runs at **20Hz** using only **15%** CPU! -Fast NMPC of MAV +Fast NMPC of MAV ## Optimal Control @@ -196,7 +196,7 @@ let status = optimizer.solve(&mut u)?; ``` See the dedicated [Rust documentation](https://alphaville.github.io/optimization-engine/docs/openrust-basic) for a full introduction and more complete examples. -See more Rust examples [here](examples). +See more Rust examples [here](rust/examples). ## Check out next... diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index e91d5115..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,74 +0,0 @@ -#This Appveyor configuration file is based on the configuration -#file of the following project: -# -#https://github.com/starkat99/appveyor-rust/ -# - -## Operating System (VM environment) ## - -# Rust needs at least Visual Studio 2013 Appveyor OS for MSVC targets. -os: Visual Studio 2015 - - -environment: - matrix: - -### MSVC Toolchains ### - - # Stable 64-bit MSVC - - channel: stable - target: x86_64-pc-windows-msvc - # Stable 32-bit MSVC - # - channel: stable - # target: i686-pc-windows-msvc - -### GNU Toolchains ### - - # Stable 64-bit GNU - # - channel: stable - # target: x86_64-pc-windows-gnu - # Stable 32-bit GNU - # - channel: stable - # target: i686-pc-windows-gnu - -### Allowed failures ### - -# See Appveyor documentation for specific details. In short, place any channel or targets you wish -# to allow build failures on (usually nightly at least is a wise choice). This will prevent a build -# or test failure in the matching channels/targets from failing the entire build. -#matrix: -# allow_failures: -# - channel: nightly - -# If you only care about stable channel build failures, uncomment the following line: - #- channel: beta - -## Install Script ## - -# This is the most important part of the Appveyor configuration. This installs the version of Rust -# specified by the 'channel' and 'target' environment variables from the build matrix. This uses -# rustup to install Rust. -# -# For simple configurations, instead of using the build matrix, you can simply set the -# default-toolchain and default-host manually here. -install: - - appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe - - rustup-init -yv --default-toolchain %channel% --default-host %target% - - set PATH=%PATH%;%USERPROFILE%\.cargo\bin - - rustc -vV - - cargo -vV - -## Build Script ## - -# 'cargo test' takes care of building for us, so disable Appveyor's build stage. This prevents -# the "directory does not contain a project or solution file" error. -build: false - -# Uses 'cargo test' to run tests and build. Alternatively, the project may call compiled programs -#directly or perform other testing commands. Rust will automatically be placed in the PATH -# environment variable. -test_script: - - cargo add roots - - cargo add ndarray --features approx - - cargo build - - cargo test --verbose %cargoflags% diff --git a/ci/script.sh b/ci/script.sh index b8d988b7..cb599288 100755 --- a/ci/script.sh +++ b/ci/script.sh @@ -1,7 +1,19 @@ #!/bin/bash set -euxo pipefail +# To use locally, from the root directory and from a bash shell... +# +# 1. To run the core Python tests: +# ci/script.sh python-tests +# +# 2. To run the Python OCP tests: +# ci/script.sh ocp-tests +# +# 3. To run the Python ROS2 tests: +# ci/script.sh ros2-tests + SKIP_RPI_TEST="${SKIP_RPI_TEST:-0}" +DO_DOCKER="${DO_DOCKER:-0}" TASK="${1:-all-python-tests}" function run_clippy_test() { @@ -25,7 +37,7 @@ function run_clippy_test() { } setup_python_test_env() { - cd open-codegen + cd python export PYTHONPATH=. python -m venv venv @@ -106,36 +118,37 @@ test_docker() { } main() { - if [ $DO_DOCKER -eq 0 ]; then - case "$TASK" in - python-tests) - echo "Running Python tests and generated Clippy tests" - setup_python_test_env - run_python_core_tests - ;; - ros2-tests) - echo "Running ROS2 Python tests" - setup_python_test_env - run_python_ros2_tests - ;; - ocp-tests) - echo "Running OCP Python tests" - setup_python_test_env - run_python_ocp_tests - ;; - all-python-tests) - echo "Running Python tests, generated Clippy tests, and OCP tests" - all_python_tests - ;; - *) - echo "Unknown task: $TASK" - exit 1 - ;; - esac - else + if [ "$DO_DOCKER" -ne 0 ]; then echo "Building Docker image" test_docker + return fi + + case "$TASK" in + python-tests) + echo "Running Python tests and generated Clippy tests" + setup_python_test_env + run_python_core_tests + ;; + ros2-tests) + echo "Running ROS2 Python tests" + setup_python_test_env + run_python_ros2_tests + ;; + ocp-tests) + echo "Running OCP Python tests" + setup_python_test_env + run_python_ocp_tests + ;; + all-python-tests) + echo "Running Python tests, generated Clippy tests, and OCP tests" + all_python_tests + ;; + *) + echo "Unknown task: $TASK" + exit 1 + ;; + esac } main diff --git a/ci/sphinx-documentation.sh b/ci/sphinx-documentation.sh index 452f057e..12a3794b 100644 --- a/ci/sphinx-documentation.sh +++ b/ci/sphinx-documentation.sh @@ -27,7 +27,7 @@ pip install sphinx pip install sphinx-rtd-theme # Install opengen -pushd open-codegen +pushd python pip install . popd # back to $GITHUB_WORKSPACE @@ -48,11 +48,11 @@ git checkout $current_branch # Build the docs rm -rf sphinx mkdir -p sphinx -pushd sphinx-dox -sphinx-apidoc -o ./source/ ../open-codegen/opengen +pushd docs/sphinx +sphinx-apidoc -o ./source/ ../../python/opengen echo Last updated: $(date -u) >> source/index.rst; sed '$d' source/index.rst; # update date at the end of file make html || : -cp -r build/html/ ../sphinx +cp -r build/html/ ../../sphinx git checkout source/index.rst # no need to commit this popd # back to $GITHUB_WORKSPACE diff --git a/docs/algorithm.md b/docs/content/algorithm.md similarity index 100% rename from docs/algorithm.md rename to docs/content/algorithm.md diff --git a/docs/cite_open.md b/docs/content/cite_open.md similarity index 100% rename from docs/cite_open.md rename to docs/content/cite_open.md diff --git a/docs/contributing.mdx b/docs/content/contributing.mdx similarity index 93% rename from docs/contributing.mdx rename to docs/content/contributing.mdx index 7671c872..a3541427 100644 --- a/docs/contributing.mdx +++ b/docs/content/contributing.mdx @@ -90,12 +90,12 @@ We follow [this style guide](https://www.python.org/dev/peps/pep-0008) and its [ ### Website -This documentation is generated with Docusaurus - read a detailed guide [here](https://github.com/alphaville/optimization-engine/blob/master/website/README.md). +This documentation is generated with Docusaurus - read a detailed guide [here](https://github.com/alphaville/optimization-engine/blob/master/docs/website/README.md). -- All docs are in `docs/` -- Blog entries are in `website/blog/` +- All docs are in `docs/content/` +- Blog entries are in `docs/website/blog/` -To start the website locally (at [http://localhost:3000/optimization-engine](http://localhost:3000/optimization-engine)) change directory to `website` and run `yarn start`. To update the website, execute `./publish.sh` (you need to be a collaborator on github). +To start the website locally (at [http://localhost:3000/optimization-engine](http://localhost:3000/optimization-engine)) change directory to `docs/website` and run `yarn start`. To update the website, execute `./publish.sh` from there (you need to be a collaborator on github). ## Using Git When using Git, keep in mind the following guidelines: @@ -172,9 +172,9 @@ This will have to be a new PR. Checklist: