scippneutron.metadata.Software#
- class scippneutron.metadata.Software(**data)[source]#
A piece of software.
The piece of software should be specified as precisely as possible. For example, a release version of ScippNeutron could be specified as follows:
>>> from scippneutron.metadata import Software >>> software = Software( ... name='ScippNeutron', ... version='24.11.0', ... url='https://github.com/scipp/scippneutron/releases/tag/24.11.0', ... doi='https://doi.org/10.5281/zenodo.14139599', ... )
A development version might include a Git hash in the version. Alternative methods can be used for projects that do not use Git. But the software should be specified as precisely as possible. For example:
>>> software = Software( ... name='ScippNeutron', ... version='24.11.1.dev8+g10d09ab0', ... url='https://github.com/scipp/scippneutron', ... )
The URL can either point to the source code, a release artifact, or a package index, such as
pypi.orgoranaconda.org.- field doi: str | None = None#
DOI of the concrete version of the software.
If there is no DOI for the concrete version, a general DOI for the software may be used.
- classmethod from_package_metadata(package_name)[source]#
Construct a Software instance from the metadata of an installed package.
This function attempts to deduce all information it can from package metadata. But it only has access to the information that is encoded in the package. It therefore returns the base project URL instead of a concrete release URL, and it does not return a DOI.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- field name: str [Required]#
Name of the piece of software.
- field url: str | None = None#
URL to the concrete version of the software.
If no URL for a concrete version is available, a URL of the project or source code may be used.
- field version: str [Required]#
Complete version of the piece of software.