Package: cidc-schemas
cidc-schemasBranchStatusMaintainabilityTest CoverageCode StylemasterThis repository contains formal definitions of the CIDC metadata model usingjson-schemasyntax and vocabulary.View documentation athttps://cimac-cidc.github.io/cidc-schemas/InstallationTo install the latest released version, run:pipinstallcidc-schemasDevelopmentProject Structurecidc_schemas/- a python module for generating, validating, and reading manifest and assay templates.schemas/- json specifications defining the CIDC metadata model.templates/- schemas for generating and validating manifest and assay templates.assays/- schemas for defining assay data models.artifacts/- schemas for defining artifacts.docs/- the most recent build of the data model documentation, along with templates and scripts for re-generating the documentation.template_examples/- example populated Excel files for template specifications inschemas/templates, and.csvs auto-generated from those.xlsxs that allow to transparently keep track of changes in them.tests/- tests for thecidc_schemasmodule..githooks/- git hooks, e.g. for auto-generating.csvs intemplate_examples/and.htmldocumentation files.Developer SetupInstall necessary dependencies.pipinstall-rrequirements.dev.txtInstall and configure pre-commit hooks.pre-commitinstallJIRA IntegrationTo set-up the git hook for JIRA integration, run:ln-s../../.githooks/commit-msg.git/hooks/commit-msg
chmod+x.git/hooks/commit-msg
rm.git/hooks/commit-msg.sampleThis symbolic link is necessary to correctly link files in.githooksto.git/hooks. Note that setting thecore.hooksPathconfiguration variable would lead topre-commit failing. Thecommit-msghookruns afterthepre-commithook, hence the two are de-coupled in this workflow.To associate a commit with an issue, you will need to reference the JIRA Issue key (For eg 'CIDC-1111') in the corresponding commit message.Running testsThis repository has unit tests in thetestsfolder. After installing dependencies
the tests can be run via the commandpytesttestsBuilding documentationPre-commit hooks ensure documentation is automatically up-to date. To build the documentation manually, run the following commands:pythonsetup.pyinstall# install helpers from the cidc_schemas librarypythondocs/generate_docs.pyThis will output the generated html documents indocs/docs. If the updated docs are pushed up and merged into master, they will be viewable athttps://cimac-cidc.github.io/cidc-schemas/.Using the Command-Line InterfaceThis project comes with a command-line interface for validating schemas and generating/validating assay and manifest templates.Install the CLIClone the repository and cd into itgitclonegit@github.com:CIMAC-CIDC/cidc-schemas.gitcdcidc-schemasInstall thecidc_schemaspackage (this adds thecidc_schemasCLI to your console)pythonsetup.pyinstallRuncidc_schemas --helpto see available options.If you're making changes to the module and want those changes to be reflected in the CLI without reinstalling thecidc_schemasmodule every time, runpython3-mcidc_schemas.cli[args]Generate templatesCreate a template for a given template configuration.cidc_schemasgenerate_template-mtemplates/manifests/pbmc_template.json-opbmc.xlsxValidate filled-out templatesCheck that a populated template file is valid with respect to a template specification.cidc_schemasvalidate_template-mtemplates/manifests/pbmc_template.json-xtemplate_examples/pbmc_template.xlsxValidate JSON schemasCheck that a JSON schema conforms to the JSON Schema specifications.cidc_schemasvalidate_schema-fshipping_core.json