Installation#

Stable release#

Installation of the latest stable release version.

With conda:

$ conda install -c conda-forge pyhdx

With pip:

$ pip install pyhdx

To install with web application:

$ pip install pyhdx[web]

To install with pdf output:

$ pip install pyhdx[pdf]

Running the web server#

PyHDX web application can be launched from the command line using pyhdx command with below options,

To run PyHDX server using default settings on your local server:

$ pyhdx serve

To run PyHDX server using the IP address and port number of your dask cluster:

$ pyhdx serve --scheduler_address <ip>:<port>

If no dask cluster is found at the specified address, a LocalCluster will be started (on localhost) using the specified port number.

To start a dask cluster separately, open another terminal tab and run:

python local_cluster.py

This will start a Dask cluster on the scheduler address as specified in the PyHDX config.

Install from source#

Create a new conda environment:

$ conda create --name py38_pyhdx python=3.8
# conda activate py38_pyhdx

Clone the github repository:

$ git clone https://github.com/Jhsmit/PyHDX
$ cd PyHDX

Dependencies can then be installed either from pinned versions or by using pip/conda to resolve dependencies.

Pinned Dependencies#

You can use one of the files in ‘requirements/pinned’ to install a pretested set of pinned dependencies.

With pip:

$ pip install -r requirements/pinned/py38_windows_pip.txt

Or use 'py38_linux_pip.txt' (These files should be the same)

With conda:

$ conda env create -f requirements/py38_windows_conda.yml

Or use the file 'py38_linux_conda.yml' for Linux.

Resolve Dependencies#

Dependencies can alternatively be installed by letting pip or conda resolve versions from requirements files. For conda (untested for pip), this can take a long time, so using Mamba is recommended.

If you would like a specific PyTorch version to use with PyHDX (ie CUDA/ROCm support), you should install this first. Installation instructions are on the Pytorch website.

Then, install the other base dependencies and optional extras.

To install all dependencies, including development tools:

$ conda install --file requirements/req-all.txt -c conda-forge

Or choose which extras to install by using the 'req-<extra>.txt' files.

Install PyHDX in develop/editable mode

$ conda develop .

Or

$ pip install -e

Running from source#

To run the web application:

$ python pyhdx/web/serve.py

This runs the pyhx web application without a Dask cluster to submit jobs to, so submitting a fitting job will give an error.

To start a dask cluster separately, open another terminal tab and run:

$ python pyhdx/local_cluster.py

Configuration#

A configuration file is located in the .pyhdx folder in the user home directory. This file is used by default and can be edited to change PyHDX default settings.

Alternatively, users can create additional .yaml configuration files in this directory, after which the scripts local_cluster.py and serve.py prompt the user for which file to use.

The section server configures the panel server settings. In this section the additional keys port and websocket_origin can be added, which are passed to panel.serve. See the panel Deploy and Export deploy section for more information.