Skip to content

Latest commit

 

History

History
79 lines (54 loc) · 3.14 KB

File metadata and controls

79 lines (54 loc) · 3.14 KB

Contributing to SBOL Converter

This document outlines the process for contributing to the SBOL Converter project. We welcome contributions of all kinds, including bug fixes, new features, and improvements to documentation.

Table of Contents

Finding Issues

  • GitHub Issues: The primary place to find issues is on the SBOL-utilities GitHub repository.
  • Issue Labels: Issues are labeled to help you find relevant tasks. Look for labels like sbol-converter.

Code Location

The SBOL Converter code is located within the sbol-utilities repository.

  • The core code for the converter is located in the sbol_utilities/sbol3_sbol2_conversion.py file.
  • The tests for the converter are located in the test/test_sbol2_sbol3_direct.py directory.

Local Installation

To work on the SBOL Converter, you'll need to install it locally. Follow these steps:

  1. Clone the Repository:

    git clone https://github.com/SynBioDex/SBOL-utilities.git
    cd SBOL-utilities
  2. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate
  3. Install libraries locally:

    You may also have to setuptools using:

    pip install setuptools

    Install SBOL Utilities locally

    python setup.py install
  4. Ensure that you are able to run the tests:

    python test/test_sbol2_sbol3_direct.py

Writing Tests

It's recommended that you prepare a test and a test file before starting to write your converter code.

To make a new test:

  • Take a file from SBOL Test Suite, or make one using pySBOL2 (suggested: use the existing SBOL Notebooks)

  • In case you're using pySBOL2, make sure to have these configurations:

    Config.setOption(ConfigOptions.SBOL_COMPLIANT_URIS, True)
    Config.setOption(ConfigOptions.SBOL_TYPED_URIS, False)
    
  • Validate the file with the online Validator. It shouldn't throw any validation errors

  • Put the file in the test/test_files

  • Write a new test function in test_sbol2_sbol3_direct.py (follow what the other tests are doing: create a document based on the file, call conversion, convert back to original SBOL version, and check for differences)

  • Now you can write the new converter functionality to make that test pass

  • Note that after completing the converter code, there will still be errors saying the objects are missing backport triples from the roundtrip conversion. To deal with those you need to add backport variables to your objects in the XML file. Add xmlns:backport="http://sboltools.org/backport#" to the namespaces at the beginning of the file and <backport:sbol3namespace rdf:resource="https://github.com"/> to each object