Adding new projects to experimental
Purpose
The folder experimental is for code that is candidate for being added to OSCAR. In particular, this includes the following cases:
- Code from an external package that should be moved to OSCAR
- Implementing a new feature from scratch
- In general: code whose API has not stabilized yet
The code in experimental is supposed to be mathematically correct, experimental is a staging area for new features whose interface is still to be stabilized. Also code is allowed to reside in experimental while it is brought up to OSCAR standard.
- Code from
srcmust never use code fromexperimental - Say there are two projects
AandBinexperimental, andBdepends onA. That means thatBcannot be moved tosrcbeforeA. Worse: IfAgets abandoned,Bmight share that fate. So please consider carefully in such situations.
Structure
For an example of the structure for a new project in experimental have a look at project folders, i.e. experimental/PROJECT_NAME, that have subfolders docs, src, and test. The general structure is
experimental/PROJECT_NAME/
├── README.md
├── docs
│ ├── doc.main
│ └── src
│ └── DOCUMENTATION.md
├── src
│ └── PROJECT_NAME.jl
└── test
└── *.jlThe file src/PROJECT_NAME.jl and at least one .jl file in the test/ directory are mandatory and are used by Oscar.jl to find your code and tests. If there is a test/runtests.jl then only this file is executed during testing, otherwise all .jl files will be run automatically (in a random order).
The file docs/doc.main is used for integrating your documentation in the OSCAR manual under the Experimental section. Optionally please provide a README.md describing your project and its goals, especially if you are starting from scratch and don't have any documentation yet.
Useful functions for development
Apart from the hints in the Introduction for new developers, there are some more specialized functions for the structure of the experimental folder.
test_experimental_module — Functiontest_experimental_module(project::AbstractString; file::AbstractString="",
new::Bool=true, timed::Bool=false, ignore=[])Run the Oscar tests of the experimental module project:
- if
fileis empty, run the entire test suite inexperimental/<project>/test - if
experimental/<project>/test/<file>is a directory which contains aruntests.jl, run this file, otherwise run all test files in that directory and below - if
experimental/<project>/test/<file>orexperimental/<project>/test/<file>.jlis a file, run this file
The default is to run the entire test suite of the module project.
The optional parameter new takes the values false and true (default). If true, then the tests are run in a new session, otherwise the currently active session is used.
With the optional parameter timed the function will return a dict mapping file names to a named tuple with compilation times and allocations. This only works for new=false.
The parameter ignore can be used to pass a list of String or Regex patterns. Test files or folders matching these will be skipped. Strings will be compared as suffixes. This only works for new=false.
Procedure for adding a new feature
Ideally we envision the procedure to follow along the following lines.
- The new feature is implemented in the
experimentalfolder. - For external authors, a maintainer is assigned to guide the authors such that the implementation adheres to the Developer Style Guide and the Design Decisions. Please get in touch with us as soon as possible, preferably on the OSCAR Slack.
- The new feature is tested thoroughly, other people are invited to test the new feature.
- In the end there are three possibilities:
- The feature is considered done and moved into
srcas is. - The feature is discarded, e.g., because it cannot be maintained.
- Parts of the feature are moved into
src, others are discarded.
- The feature is considered done and moved into
Criteria for acceptance
The main criteria for acceptance are:
- The code adheres to the Developer Style Guide and the Design Decisions.
- The new code is well tested.
- It is clear who maintains the new code, i.e. the original authors commit to maintaining the code in the future.