Configuration#

NNConfig is the configuration object: one section per nextnano product, holding where that product is installed and how it is to be run. The configuration the whole process shares is reached as nextnanopy.config, and that is the object every input file copies from when it is built.

import nextnanopy

config = nextnanopy.config
config.set('nextnano++', 'exe', r'C:\Program Files\nextnano\bin\nextnano++.exe')
config.save()

The first access to nextnanopy.config calls get_config, which reads .nextnanopy-config in your home directory and writes it with the defaults if it is not there yet. Every later access returns that same object which is why config.set(...) above is seen by the input files you create afterwards.

A value set this way is process wide. config.save() writes it to the file, so the next process starts from it as well.

NNConfig

The nextnano configuration: where each product sits and how it is to be run.

get_config

Return the process-wide NNConfig, building it on first use.