User Guide#
Installation#
The nextnanopy Python package can be installed on Linux, macOS and Windows. It requires Python 3.10 or later, the versions we actively test against.
A valid nextnano license is not required for the general use of nextnanopy — only if you want to execute input files (run simulations) via Python. See Set up the configuration below.
Note
Installing into your plain, system-wide Python works fine — if you are just
getting started, you can run the pip install commands below as they are.
That said, it is good practice to install packages into an isolated virtual
environment so that each project keeps its own set of dependencies. You can
create one with the built-in
venv module or with a
distribution such as conda; activate it first,
then run the pip install commands inside it. If an install fails with a
permission denied error, either install into a per-user Python or virtual
environment, or re-run the command in a terminal with administrator rights.
nextnanopy is a plain Python library, so any editor works. Common choices are VS Code, JupyterLab (good for the example notebooks) and Spyder; none of them are required.
Install the latest release (recommended)#
Run the following in your Python environment of choice:
pip install nextnanopy
To upgrade to the latest version later:
pip install --upgrade nextnanopy
Development install from source#
Installing from source keeps the templates/ and docs/ examples locally
and lets you edit the library and contribute changes back. nextnanopy is an
open repository on GitHub —
contributions are very welcome!
Clone the repository into a directory of your choice, then install it in editable mode:
git clone https://github.com/nextnano-GmbH/nextnanopy.git
cd nextnanopy
pip install -e .
To upgrade later, pull the latest changes from inside the folder:
git pull
Optional features#
Some features rely on extra packages that are not installed by default. Install them via the corresponding extras:
pip install "nextnanopy[plot]" # plotting helpers (DataFile.plot, styles)
pip install "nextnanopy[gds]" # import shapes from GDS files
pip install "nextnanopy[post]" # post-processing (CV curves, minimization)
pip install "nextnanopy[all]" # everything above
The same extras work with the editable install, e.g. pip install -e ".[all]".
The required packages are installed automatically:
The extras pull in additional packages:
Matplotlib and Cycler — visualize data (
plot)gdspy and Shapely — import and manipulate polygons from GDS files (
gds)SciPy — post-processing (
post)
Set up the configuration#
To execute input files (run simulations) you need a valid nextnano license and a configuration file for nextnanopy that points at your nextnano executables, databases and license. Follow Tutorial 0 - Set up the configuration to create it.
You can also export the settings and paths already stored in nextnanomat into a nextnanopy config format; see nextnanomat for more details.
Where to start?#
You can start with the following tutorials: Tutorials. We also provide sample scripts for nextnano++, nextnano³, nextnano.NEGF and nextnano.MSB.
Using old style txt license file#
Yes, nextnanopy can be used with the old style txt license. In addition to specifying the path to the txt license in the nextnanopy config file, you must also pass an extra command to the InputFile.execute() method:
...
input_file = nextnanopy.InputFile("path_to_your_input_file")
input_file.execute(no_file_options="--old")
...
The .txt license can be used in the same way for sweeps:
...
sweep = nextnanopy.Sweep(sweep_parameters, input_file_path)
sweep.save_sweep()
sweep.run(no_file_options="--old")
...