Create and register the plugin module

Create and register the plugin module#

Here, one should add the model to the list of model plugins recognized by the CIF. The list of available plugins can be accessed here. General instruction on how to register new plugins are given here.

  1. Go to the directory “pycif/plugins/models/”

  2. Copy the template to a folder with your model name

  3. Edit the __init__.py file and add the following lines:

    _name = "YOUR MODEL NAME"
    _version = "YOUR MODEL VERSION (optional)"
    

    When registering, pay attention to not replicate an already existing model!

  4. Check that your model is available in pyCIF. Your model should appear in the list when typing the following commands in python:

    from pycif.utils.classes.baseclass import Plugin
    Plugin.print_registered()
    
  5. Check that your model initializes properly using the following yaml and changing the name and version of your model

     1#####################
     2# pyCIF config file #
     3#####################
     4
     5# Define here all parameters for pyCIF following YAML syntax
     6# For details on YAML syntax, please see:
     7# http://docs.ansible.com/ansible/latest/YAMLSyntax.html
     8
     9###############################################################################
    10# pyCIF parameters
    11
    12rootdir: &rootdir /tmp/CIF/
    13outdir: &outdir /tmp/pytest-of-root/pytest-0
    14verbose: 2
    15workdir: !!python/object/apply:pathlib.PosixPath
    16- /
    17- tmp
    18- pytest-of-root
    19- pytest-0
    20- 1_register
    21logfile: log.txt
    22datei: 2000-01-01 00:00:00
    23datef: 2000-02-01 00:00:00
    24
    25###############################################################################
    26
    27# http://community-inversion.eu/documentation/plugins/models/template.html
    28
    29model:
    30  plugin:
    31    name: template
    32    version: std