A Python package and scripts for the evaluation of nonlinear interference noise in single mode fiber transmissions
Just clone the repository and pip install it.
git clone https://github.com/geeanlooca/PyNLIN.git
cd PyNLIN
pip install .I usually like to install the core numerical packages from conda directly, and let pip manage the rest of the dependencies.
conda create -n <env> python=3.10 --yes
conda activate <env>
conda install numpy scipy matplotlib h5pypython -m <env>
source <env>/bin/activate # <env>\Scripts\activate.bat under WindowsFor development purposes, the package should be installed in the editable mode. Changes you make to the package are immediatly reflected on the installed version and consequently on the scripts using the package.
From the root of the repository:
make installor
pip install -e .[dev]Packaging the code in a Singularity image allows us to run code using PyNLIN on the Department's SLURM cluster.
There are two main ways in which you can run build and run a Singularity image:
- Install Singularity on your local machine, build the image, copy it to the cluster, and submit a job using the image.
- Build the image using the remote builder and pull the image directly on the cluster to avoid wasting too much time on uploading the image.
⚠️ **The image pulls the latest commit on themainbranch directly from GitHub. Local edits or commits not pushed to GitHub will not be reflected in the resulting image file
Once you have Singularity installed, just run
sudo singularity build --force singularity.sif singularity.defThe resulting .sif image file can be used to run python scripts locally using
singularity exec singularity.sif python <script>.pyor uploaded to the cluster.
An example .slurm file to run a job on the cluster is provided in the slurm/ directory of this repository.