diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..de6008023 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,72 @@ +name: 🐞 Bug report +description: Something in ProxSuite is not working the way it should +title: "[Bug]: bug title" +labels: ["bug"] + +body: + - type: markdown + attributes: + value: | + Follow the [contributing guidelines](../../development/contributing.md). + + If you have a question about how to use ProxSuite, open a [discussion](https://github.com/Simple-Robotics/proxsuite/discussions). + + - type: textarea + id: description + attributes: + label: 🐞 Bug + description: A clear and concise description of what the bug is. + validations: + required: true + + - type: textarea + id: reproduce + attributes: + label: Reproduction steps + description: | + Steps to reproduce the behavior. Provide a minimal example that reproduces the bug + and a Dockerfile if it's an installation issue. Error messages and stack traces are also helpful. + Use [Markdown code blocks](https://help.github.com/en/articles/creating-and-highlighting-code-blocks) for code and stack traces. + value: | + ```python + import proxsuite + ``` + + - type: textarea + id: traceback + attributes: + label: Relevant log output / Error message + description: Copy and paste any relevant log output or error message. + placeholder: Segmentation fault... + render: shell + + - type: textarea + id: system-info + attributes: + label: System Info + description: | + Describe the characteristics of your environment: + * OS + * Package manager used + * proxsuite version or SHA1 if built from source + * All dependency versions + * Compiler + * CMake arguments + * CMake output + + - type: checkboxes + id: terms + attributes: + label: Checklist + options: + - label: I have checked that all my packages are installed from the same package manager (conda-forge, Nix, PyPI, robotpkg, ROS, ...) + required: true + - label: I have checked that there is no similar [issue](https://github.com/Simple-Robotics/proxsuite/issues)/[discussion](https://github.com/Simple-Robotics/proxsuite/discussions) + in the repo + required: true + - label: I have provided a minimal and working example to reproduce the bug + required: true + - label: I have used [Markdown code blocks](https://help.github.com/en/articles/creating-and-highlighting-code-blocks) for code, stack traces and + compiler errors + required: true + - label: I have used an AI assistant diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 000000000..561491e2f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,49 @@ +name: 💡 Feature request +description: Suggest an idea to improve ProxSuite +title: "[Feature]: feature title" +labels: ["feature request"] + +body: + - type: markdown + attributes: + value: | + Follow the [contributing guidelines](../../development/contributing.md). + + If you have a question about how to use ProxSuite, open a [discussion](https://github.com/Simple-Robotics/proxsuite/discussions). + + - type: textarea + id: description + attributes: + label: 🚀 Feature + description: A clear and concise description of the feature proposal. + validations: + required: true + + - type: textarea + id: motivation + attributes: + label: Motivation + description: Outline the motivation for the proposal. Is the request related to a problem? For example, "I'm always frustrated when [...]". If it + is related to another GitHub issue, link it here. + + - type: textarea + id: alternatives + attributes: + label: Alternatives + description: A clear and concise description of the alternative solutions or features you considered. + + - type: textarea + id: additional-context + attributes: + label: Additional context + description: Add any other context or screenshots about the feature request here. + + - type: checkboxes + id: terms + attributes: + label: Checklist + options: + - label: I have checked that there is no similar [issue](https://github.com/Simple-Robotics/proxsuite/issues)/[discussion](https://github.com/Simple-Robotics/proxsuite/discussions) + in the repo + required: true + - label: I have used an AI assistant diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..e8df5904f --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,24 @@ + + +## Description + + + +## Checklist + +- [ ] I have read the [contributing guidelines](../development/contributing.md) +- [ ] I have run `pre-commit run --all-files` or `pixi run lint` +- [ ] I have reviewed my own code +- [ ] I have commented my code where necessary +- [ ] I have made corresponding changes to the Doxygen documentation +- [ ] I have added tests that prove my fix or feature works +- [ ] I have updated the [CHANGELOG](https://github.com/Simple-Robotics/proxsuite/blob/devel/CHANGELOG.md) or added the "no changelog" label for CI or infra changes +- [ ] I have updated the [README credits section](https://github.com/Simple-Robotics/proxsuite?tab=readme-ov-file#credits) +- [ ] I have used an AI assistant diff --git a/.gitignore b/.gitignore index 50e5b7617..60cfca1ca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -build* +build/* Xcode* *.pyc .vscode* \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..79586ebb8 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,89 @@ + +# Contributor Covenant 3.0 Code of Conduct + +## Our Pledge + +We pledge to make our community welcoming, safe, and equitable for all. + +We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or religion, national or social origin, socio-economic position, level of education, or other status. The same privileges of participation are extended to everyone who participates in good faith and in accordance with this Covenant. + +## Encouraged Behaviors + +While acknowledging differences in social norms, we all strive to meet our community's expectations for positive behavior. We also understand that our words and actions may be interpreted differently than we intend based on culture, background, or native language. + +With these considerations in mind, we agree to behave mindfully toward each other and act in ways that center our shared values, including: + +1. Respecting the **purpose of our community**, our activities, and our ways of gathering. +2. Engaging **kindly and honestly** with others. +3. Respecting **different viewpoints** and experiences. +4. **Taking responsibility** for our actions and contributions. +5. Gracefully giving and accepting **constructive feedback**. +6. Committing to **repairing harm** when it occurs. +7. Behaving in other ways that promote and sustain the **well-being of our community**. + + +## Restricted Behaviors + +We agree to restrict the following behaviors in our community. Instances, threats, and promotion of these behaviors are violations of this Code of Conduct. + +1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary personal attention after any clear request to stop. +2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a community member or group of people. +3. **Stereotyping or discrimination.** Characterizing anyone’s personality or behavior on the basis of immutable identities or traits. +4. **Sexualization.** Behaving in a way that would generally be considered inappropriately intimate in the context or purpose of the community. +5. **Violating confidentiality**. Sharing or acting on someone's personal or private information without their permission. +6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any person or group. +7. Behaving in other ways that **threaten the well-being** of our community. + +### Other Restrictions + +1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be someone else to evade enforcement actions. +2. **Failing to credit sources.** Not properly crediting the sources of content you contribute. +3. **Promotional materials**. Sharing marketing or other commercial content in a way that is outside the norms of the community. +4. **Irresponsible communication.** Failing to responsibly present content which includes, links or describes any other restricted behaviors. + + +## Reporting an Issue + +Tensions can occur between community members even when they are trying their best to collaborate. Not every conflict represents a code of conduct violation, and this Code of Conduct reinforces encouraged behaviors and norms that can help avoid conflicts and minimize harm. + +When an incident does occur, it is important to report it promptly. To report a possible violation, **send an email to simple-robotics-contact@inria.fr** + +Community Moderators take reports of violations seriously and will make every effort to respond in a timely manner. They will investigate all reports of code of conduct violations, reviewing messages, logs, and recordings, or interviewing witnesses and other participants. Community Moderators will keep investigation and enforcement actions as transparent as possible while prioritizing safety and confidentiality. In order to honor these values, enforcement actions are carried out in private with the involved parties, but communicating to the whole community may be part of a mutually agreed upon resolution. + + +## Addressing and Repairing Harm + +If an investigation by the Community Moderators finds that this Code of Conduct has been violated, the following enforcement ladder may be used to determine how best to repair harm, based on the incident's impact on the individuals involved and the community as a whole. Depending on the severity of a violation, lower rungs on the ladder may be skipped. + +1) Warning + 1) Event: A violation involving a single incident or series of incidents. + 2) Consequence: A private, written warning from the Community Moderators. + 3) Repair: Examples of repair include a private written apology, acknowledgement of responsibility, and seeking clarification on expectations. +2) Temporarily Limited Activities + 1) Event: A repeated incidence of a violation that previously resulted in a warning, or the first incidence of a more serious violation. + 2) Consequence: A private, written warning with a time-limited cooldown period designed to underscore the seriousness of the situation and give the community members involved time to process the incident. The cooldown period may be limited to particular communication channels or interactions with particular community members. + 3) Repair: Examples of repair may include making an apology, using the cooldown period to reflect on actions and impact, and being thoughtful about re-entering community spaces after the period is over. +3) Temporary Suspension + 1) Event: A pattern of repeated violation which the Community Moderators have tried to address with warnings, or a single serious violation. + 2) Consequence: A private written warning with conditions for return from suspension. In general, temporary suspensions give the person being suspended time to reflect upon their behavior and possible corrective actions. + 3) Repair: Examples of repair include respecting the spirit of the suspension, meeting the specified conditions for return, and being thoughtful about how to reintegrate with the community when the suspension is lifted. +4) Permanent Ban + 1) Event: A pattern of repeated code of conduct violations that other steps on the ladder have failed to resolve, or a violation so serious that the Community Moderators determine there is no way to keep the community safe with this person as a member. + 2) Consequence: Access to all community spaces, tools, and communication channels is removed. In general, permanent bans should be rarely used, should have strong reasoning behind them, and should only be resorted to if working through other remedies has failed to change the behavior. + 3) Repair: There is no possible repair in cases of this severity. + +This enforcement ladder is intended as a guideline. It does not limit the ability of Community Managers to use their discretion and judgment, in keeping with the best interests of our community. + + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public or other spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 3.0, permanently available at [https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/). + +Contributor Covenant is stewarded by the Organization for Ethical Source and licensed under CC BY-SA 4.0. To view a copy of this license, visit [https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/) + +For answers to common questions about Contributor Covenant, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are provided at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations). Additional enforcement and community guideline resources can be found at [https://www.contributor-covenant.org/resources](https://www.contributor-covenant.org/resources). The enforcement ladder was inspired by the work of [Mozilla’s code of conduct team](https://github.com/mozilla/inclusion). diff --git a/README.md b/README.md index 271cfc1b9..45a6903b4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# ProxSuite +

Proxsuite Logo

@@ -22,6 +24,28 @@ Through **ProxSuite**, we aim to offer the community scalable optimizers that de We are ready to integrate **ProxSuite** within other optimization ecosystems. +## Table of contents +- [ProxSuite](#proxsuite) + * [ProxSuite main features](#proxsuite-main-features) + * [Documentation](#documentation) + * [Getting started](#getting-started) + + [Quick install with :](#quick-install-with-) + + [Quick install with :](#quick-install-with--1) + + [Quick install with :](#quick-install-with--2) + + [Alternative approaches](#alternative-approaches) + + [Compiling a first example program](#compiling-a-first-example-program) + + [Using ProxSuite with CMake](#using-proxsuite-with-cmake) + * [**ProxQP**](#proxqp) + + [Citing **ProxQP**](#citing-proxqp) + + [Numerical benchmarks](#numerical-benchmarks) + * [**QPLayer**](#qplayer) + + [Citing **QPLayer**](#citing-qplayer) + * [Installation procedure](#installation-procedure) + * [Contribution](#contribution) + * [Core-dev team](#core-dev-team) + * [Credits](#credits) + + ## ProxSuite main features **Proxsuite** is fast: @@ -169,3 +193,41 @@ If you are using **QPLayer** for your work, we encourage you to [cite the relate ## Installation procedure Please follow the installation procedure [here](https://github.com/Simple-Robotics/proxsuite/blob/devel/doc/5-installation.md). + +## Contribution + +If you want to ask a question, report a bug, request a new feature or contributing with a pull requests please, follow the [contribution guideline](./development/contributing.md). + +## Core-dev team + +The currently active core developers of **ProxSuite** are: + +* [Justin Carpentier](https://jcarpent.github.io) (Inria): main developer and manager of the project +* [Guilhem Saurel](https://github.com/nim65s) (LAAS-CNRS): core maintainer +* [Joris Vailant](https://github.com/jorisv) (Inria): core developer and manager of the project +* [Lucas Haubert](https://www.linkedin.com/in/lucas-haubert-b668a421a/) (Inria): core developer +* [Fabian Schramm](https://github.com/fabinsch) (Inria): core developer +* Sarah Kazdadi (Inria): core developer +* [Jeanne Matheron](https://github.com/j-matheron) (Inria): core developer + +## Credits + +In addition to the core dev team, the following people have also been involved in the development of **ProxSuite** and are warmly thanked for their contributions: + +* [Antoine Bambade](https://bambade.github.io/) (Inria): main contributor of the dense solver and of **QPLayer** +* [Wilson Jallet](https://manifoldfr.github.io/) (Inria): main contributor of the matrix-free solver and of the Julia bindings +* [Stéphane Caron](https://scaron.info/) (Inria): for his early advices on proximal methods and his contributions to **ProxQP** +* [Wolfgang Merkt](https://wxm.io/): for his advice on packaging and his contributions to the CI +* [Quentin Le Lidec](https://quentinll.github.io/) (Inria): for his help on benchmarks +* [Louis Montaut](https://github.com/lmontaut) (Inria): for his contributions to the documentation +* [Adrien Escande](https://github.com/aescande) (Inria): for his contributions to the internal linear algebra utilities +* Oumayma Bounou (Inria): for her contributions to the PyTorch interface of **QPLayer** +* [Antoine Hoarau](https://github.com/ahoarau): for various contributions +* [Joris Gillis](https://github.com/jgillis) (KU Leuven): for various contributions +* Michael Fennel (KIT): for various contributions +* Johannes Keustermans (Spectricity): for various contributions +* J Berg: for various contributions +* [Konstantinos Chatzilygeroudis](https://github.com/costashatz): for various contributions +* [Daniel Morton](https://github.com/danielpmorton): for various contributions +* [Daisuke Nishimatsu](https://github.com/wep21): for various contributions +* Aaron Miller: for various contributions diff --git a/development/build.md b/development/build.md new file mode 100644 index 000000000..47c18c94e --- /dev/null +++ b/development/build.md @@ -0,0 +1,59 @@ +**Pixi will soon be available** + +# Build and develop with pixi + +The easiest way to set up a development environment is to use [pixi](https://pixi.sh/latest/#installation). + +[pixi](https://pixi.sh/latest/) is a cross-platform package manager for developers. +It installs all required dependencies in the `.pixi` directory. +It's used by our CI, so you get the same stable and tested dependencies. + +Run the following command to install dependencies, configure, build and test the project: + +```bash +pixi run test +``` + +The project is built in the `build` directory. + +The typical workflow is: + +```bash +pixi shell +pixi run configure +ninja -C build +``` + +After `pixi run configure`, use `cmake` and `ninja` manually to reconfigure and build the project. + +## Environments + +The pixi manifest contains many environments. The most common ones are: + +- **default**: core proxsuite +- **all**: all proxsuite features + +To activate a specific environment, run: + +```bash +pixi shell -e all +``` + +Using **all** makes it easy to choose which features to build. +In this case, use the following CMake options: +- `BUILD_WITH_CHOLMOD_SUPPORT` : Build ProxSuite with the Cholmod support +- `BUILD_WITH_ACCELERATE_SUPPORT` : Build ProxSuite with the Accelerate support +With the **all** environment, all these options are ON. +To turn one off, pass the corresponding `-D` flag to `cmake`: + +```bash +cmake -B build -DGENERATE_PYTHON_STUBS=OFF +``` + +## Faster build + +When you work on a single feature with one associated test,build and run the corresponding test: +```bash +ninja -C build proxsuite-test-cpp- +ctest --test-dir build --output-on-failure -R proxsuite-test-cpp- +``` diff --git a/development/contributing.md b/development/contributing.md new file mode 100644 index 000000000..bb5a5f3ce --- /dev/null +++ b/development/contributing.md @@ -0,0 +1,184 @@ +# Contributing Guidelines + +Thank you for your interest in contributing to `proxsuite`. +Whether it's a bug report, a new feature, a fix, or documentation, we value every contribution. + +Read this document before opening an issue or a pull request. + +All communication on this project must follow the [Code of Conduct](../CODE_OF_CONDUCT.md). + +## Table of contents + +- [Contributing Guidelines](#contributing-guidelines) + * [Reporting bugs and feature requests](#reporting-bugs-and-feature-requests) + * [Asking questions](#asking-questions) + * [Contributing via pull requests](#contributing-via-pull-requests) + + [Choosing an issue](#choosing-an-issue) + + [Set up the development environment](#set-up-the-development-environment) + + [Pull request content](#pull-request-content) + + [Keeping the pull request up-to-date](#keeping-the-pull-request-up-to-date) + + [Running tests](#running-tests) + + [Code style](#code-style) + + [Changelog](#changelog) + * [AI-assisted contributions](#ai-assisted-contributions) + + [Responsibility](#responsibility) + + [Disclosure](#disclosure) + + [Communication](#communication) + + [Translation](#translation) + + [AI agent](#ai-agent) + * [Licensing](#licensing) + +## Reporting bugs and feature requests + +Use the GitHub [issue tracker](https://github.com/Simple-Robotics/proxsuite/issues) to report bugs or suggest features. + +Before opening an issue, check existing open and closed issues to avoid duplicates. + +Use the appropriate template and give as much detail as possible. +If you don't use the template, maintainers may close your issue without explanation. + +## Asking questions + +Ask questions in the [discussions section](https://github.com/Simple-Robotics/proxsuite/discussions). +It separates development topics from community questions. +Questions posted in the issue tracker will be moved to the discussions section. + +## Contributing via pull requests + +### Choosing an issue + +Every external contributor pull request needs an associated issue. +Open an issue first. Core developers will review it. + +An issue is ready for a pull request when: + +- It has the **ready** label. +- It is not assigned. +- It does not have the **core developers** label. + +Issues with the **core developers** label are reserved for core developers. + +If an issue meets these criteria, claim it with a short comment. + +### Set up the development environment + +The easiest way to set up a development environment is to use pixi, as described in the [build documentation](build.md). + +See the CI workflows for examples with other package managers. + +### Pull request content + +To create a pull request, follow the GitHub guides on +[forking a repository](https://help.github.com/articles/fork-a-repo/) and +[creating a pull request](https://help.github.com/articles/creating-a-pull-request/). + +In your pull request: + +- Use a descriptive title and follow the pull request template. +- If the pull request is not ready for review, keep it as a draft. +- Keep it to a single self-contained change. Don't mix unrelated fixes. +- Keep backward compatibility. Don't break the API. +- Write tests that cover your changes. +- Add an entry to the [changelog](../CHANGELOG.md). +- Make sure code style checks pass (`pixi run lint` or `pre-commit run --all-files`). +- Make sure the CI is green. Ask for help if you're stuck on a CI issue. +- Check all the appropriate items in the pull request template checklist. + +### Keeping the pull request up-to-date + +You must rebase your work on the upstream `devel` branch. + +```bash +git pull --rebase origin devel +``` + +Don't omit the `--rebase` argument or a merge commit will be created. +Using merge commits to update your pull request is discouraged as it creates +a non-linear git history. + +### Running tests + +To run the full test suite: + +```bash +pixi run test +``` + +You can also run tests manually with `ctest`. Use the `-R` option to run a single test: + +```bash +ctest --test-dir build --output-on-failure -R +``` + +### Code style + +Code style is enforced with [pre-commit](https://pre-commit.com/) hooks configured in [.pre-commit-config.yaml](../.pre-commit-config.yaml). +Before pushing your changes, run: + +```bash +pixi run lint +``` + +or directly: + +```bash +pre-commit run --all-files +``` + +### Changelog + +Add changelog entries under the `## [Unreleased]` section, +in the matching [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +category (`Added`, `Changed`, `Fixed`, `Removed`). + +Each entry is a short message followed by the pull request link, e.g.: + +``` +- Improve dense backend and simplify calculus when using a Diagonal Hessian ([#239](https://github.com/Simple-Robotics/proxsuite/pull/239)) +``` + +CI and infra-only changes should not be listed. Use the **no changelog** label in this case. + +## AI-assisted contributions + +AI-assisted contributions are more and more common. +To avoid wasting maintainers time, follow the rules below. + +AI-assisted contributions (issues, pull requests and discussions) are allowed under these rules. +Any AI-assisted contribution that doesn't follow them can be closed without explanation. + +### Responsibility + +You are responsible for the whole contribution. +Review it, understand it and be able to explain everything the AI assistant produced. +Don't shift this work to the reviewers. + +The standard pull request guidelines apply. +If some AI-proposed code doesn't look necessary or doesn't address the issue, remove it. +Some AI assistants write too many tests. Keep only the tests you need, unit test maintenance is costly. + +### Disclosure + +Disclose that you used an AI assistant. +Describing what it did is optional. + +### Communication + +Human-to-human communication matters. +Never copy-paste AI-generated text into an issue, pull request description or comment. +Write it yourself, it shows you understand the topic. +If you want to quote the AI assistant, use a code or quote block. + +### Translation + +You can use an AI assistant for translation and grammar fixes. +You are still responsible for everything it produces. + +### AI agent + +Don't submit contributions automatically with an AI agent. +It breaks the responsibility and communication rules. + +## Licensing + +All contributions to this repository are under the BSD 2-Clause License, as stated in [LICENSE](../LICENSE).