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  !join [*rootdir, /.tox/py38/tmp]
    14verbose: 2
    15workdir:  !join [*outdir, /1_register]
    16logfile: log.txt
    17datei: 2000-01-01 00:00:00
    18datef: 2000-02-01 00:00:00
    19
    20###############################################################################
    21
    22# http://community-inversion.eu/documentation/plugins/models/template.html
    23
    24model:
    25  plugin:
    26    name: template
    27    version: std