Using sygnm

From sygnm
Revision as of 21:37, 1 May 2017 by Sygnmdev (talk | contribs) (Created page with "The sygnm system can be used in multiple ways depending on the intention of the user. For relatively simple calculations, use one of the interactive clients (command line or J...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The sygnm system can be used in multiple ways depending on the intention of the user. For relatively simple calculations, use one of the interactive clients (command line or Jupyter Notebook). For more complex problems and longer programs, use the sygnm API from Python or C++. There are also bots for some web services (currently IRC and Discord). Finally, it is also possible to run the sygnm core as a standalone process and controlling it from some other process which is useful for writing sygnm clients (see the developer manual for more information).

General information

sygnm reads its configuration from a configuration file. This can be specified as a command line argument (--core.config_file <filename>). If there is no configuration file given, sygnm tries to read its configuration from the user configuration path, or if there is no such configuration file, tries to create it based on the default configuration (if available). The sygnm system searches for the default configuration template in the data path. Packages are loaded from the package paths read from the configuration file.

Overview of sygnm paths:

Path name

Description

Value

Write access needed

User configuration path

User-specific configuration files

Read from the environment in the following order (first valid one is used): SYGNM_USER_CONFIG_PATH environment variable, XDG_CONFIG_HOME environment variable (on Linux), HOME/.config (on Linux), the .config directory in the user's home folder looked up by syscall (on Linux), the current working directory.

Yes

Data path

Global (non-package) data, configuration templates and other files

Read from the environment in the following order (first valid one is used): SYGNM_DATA_PATH environment variable, a platform-specific value determined by the build system at compilation time (${CMAKE_INSTALL_PREFIX}/share), a list of platform-specific values hardcoded in the sygnm platform implementation (on Linux, these are /usr/share/, /usr/local/share/ and ./).

No

Package paths

Package files and data

Read from the configuration. Can be overridden with the SYGNM_PACKAGE_PATHS environment variable. The default value is platform-specific, determined by the build system at compilation time (${CMAKE_INSTALL_PREFIX}/lib).

No

All paths must valid for correct operation. The currently used paths will be written to the log at startup.


In addition to the configuration file, arbitrary configuration options can be specified on the command line.

Running sygnm from the build directory without installation is possible with the following command (assuming the build directory is ~/sygnm/build): SYGNM_PACKAGE_PATHS=~/sygnm/build/sygnm/src/packages SYGNM_DATA_PATH=~/sygnm/ ~/sygnm/build/sygnm/src/sygnm

In this example, the user configuration path will be determined automatically and a default configuration file will be created there.

If sygnm is installed using the build system, no manual configuration of paths is necessary.



Interactive clients

In addition to the configuration file, arbitrary configuration options can be specified on the command line.

Running sygnm-cli from the build directory without installation is possible with the following command (assuming the build directory is ~/sygnm/build): SYGNM_PACKAGE_PATHS=~/sygnm/build/sygnm/src/packages SYGNM_DATA_PATH=~/sygnm/ ~/sygnm/build/sygnm-cli/sygnm-cli

In this example, the user configuration path will be determined automatically and a default configuration file will be created there.

If sygnm is installed using the build system, no manual configuration of paths is necessary.

sygnm-jupyter consists of Jupyter Notebook kernels and a Python package. For installing the Jupyter Notebook kernels, refer to Jupyter Notebook documentation. The Python package uses setuptools, it can be installed by running python setup.py install (refer to the Python documentation for further information). Currently, the Python module is hardcoded to start sygnm without any command line parameters, so it is necessary that sygnm is correctly installed and configured before the Jupyter Notebook interface can be used.

C++ API

Python API

Bots

In addition to the configuration file, arbitrary configuration options can be specified on the command line.

Running sygnm-irc from the build directory without installation is possible with the following command (assuming the build directory is ~/sygnm/build): SYGNM_PACKAGE_PATHS=~/sygnm/build/sygnm/src/packages SYGNM_DATA_PATH=~/sygnm/ ~/sygnm/build/sygnm-irc/sygnm-irc

In this example, the user configuration path will be determined automatically and a default configuration file will be created there.

If sygnm is installed using the build system, no manual configuration of paths is necessary.