Package: polyphy-rule
PolyPhyPolyPhyis an unconventional toolkit for reconstructing continuous networks out of sparse 2D or 3D data. Such data can be defined as collections of discrete points, or a continuous sparse scalar field.PolyPhyproduces a scalar density field that defines the recovered network structure. With the help of GPU-accelerated simulation and visualization,PolyPhyprovides domain experts an interactive way to reconstruct discrete geometric data with an underlying network structure. The reconstruction is driven by theMonte Carlo Physarum Machinealgorithm, a metaheuristic inspired by the morphology and dynamics of Physarum polycephalum aka 'slime mold'.Related ResourcesPolyPhyis a successor ofPolyphormMain GitHub page:PolyPhy HubOfficial website:polyphy.ioUnderlying research:overviewandpublicationsEmail list:Google GroupsSystem RequirementsDecent GPU, recommended a mid-range discrete onecurrently running best on NVIDIA GPUs, other brands supported as well (subject to the current capabilities of theTaichi API)CPU fallback available for debugging purposesRecent Windows, Linux or Mac OSPython 3.x, Anaconda recommendedRepositoryThe main repository is located at the following GitHub URL:https://github.com/PolyPhyHub/PolyPhy.gitThe other repositories are linked from the following "org" page:https://github.com/PolyPhyHub/Running PolyPhyPlease note the project is currently undergoing a significant refactoring in order to streamline the use of the software in CLI, improve its modularity (making it easier to implement custom pipelines and extend the existing ones), and add new features (such as the recent addition of batch mode).ToinstallPolyPhy, clone this repository, open a Python console, navigate to the root of the repo, and runpip install -r requirements.txtAfterwards, navigate to the./experiments/jupyter/production/and runpython polyphy_2DDiscrete.py -f "data/csv/sample_2D_linW.csv"for the standard 2D pipeline, orpython polyphy_3DDiscrete.py -f "data/csv/sample_3D_linW.csv"to invoke the standard 3D discrete pipeline on sample data. You can also specify a custom CSV file (see the sample data for the format details, typically the data are tuples with 2 or 3 spatial coorinates followed by weights for each data point). The functionality of these pipelines is described below.To display help on the available CLI parameters, simply run the respective command without any arguments.There is also a number of notebooks implementing various pipelines (some of which are documented below). These are updated to different degrees, and we are in the process of porting them to the refactored class structure. Updates coming soon.FunctionalityThe use-cases currently supported byPolyPhyare divided according to the data workflow they are built around. Each use-case has a corresponding Jupyter notebook that implements it located in./experiments/Jupyter. This section reviews them case by case, and the following section provides an extensive tutorial recorded at the recent OSPO Symposium 2022.2D self-patterningis the most basic use-case implemented within the./experiments/Jupyter/PolyPhy_2D_discrete_datanotebook. The ability of MCPM to generate a diversity of patterns with network characteristics is achieved by disabling the data marker deposition, leaving only the MCPM agents to generate the marker responsible for maintaining structure.2D procedural pipelineprovide an easy environment to experiment with the behavior ofPolyPhyin the presence of discrete data with different spatial frequencies. Editing (adding new data points) is also supported. This pipeline is implemented in the./experiments/Jupyter/PolyPhy_2D_discrete_datanotebook.2D discrete pipelineimplements the canonical way of working with custom data defined by a CSV file. The example below demonstrates fitting to a 2D projection of the SDSS galaxy dataset. This pipeline is implemented in the./experiments/Jupyter/PolyPhy_2D_discrete_datanotebook.2D continuous pipelinedemonstrates the workflow with a continuous user-provided dataset. Instead of a discrete set of points as in the previous use-cases, the data is defined by a scalar field, which in 2D amounts to a grayscale image. The example below approximates the US road network using only a sparse population density map as the input. This pipeline is implemented in the./experiments/Jupyter/PolyPhy_2D_continuous_datanotebook.3D discrete pipelinerepresents an equivalent functionality to the originalPolyphormimplementation. The dataset consists of SDSS galaxies defined as a weighted collection of 3D points. THe visualization is based on volumetric ray marching simultaneously fetching the deposit and the trace fields. This pipeline is implemented in the./experiments/Jupyter/PolyPhy_3D_discrete_datanotebook.How to Use PolyPhyBelow is a recording of thePolyPhy Workshopgiven as part of theOSPO Symposium 2022.This 93-minute workshop coversPolyPhy's research background, all of the 5 above usecases, and extended technical discussion.ServicesToxTox is a virtual environment management and test tool that allows you to define and run custom tasks that call executables from Python packages. Tox will download the dependencies you have specified, build the package, install it in a virtual environment and run the tests using pytest. Make sure to install tox in the root of your project if you intend to work on the development.tox # download dependencies, build and install package, run teststox -e docs  # to build your documentationtox -e build  # to build your package distributiontox -e publish  # to test your project uploads correctly in test.pypi.orgtox -e publish --repository pypi  # to release your package to PyPItox -av  # to list all the tasks availableGitHub ActionsGitHub Actions is being used to test on MacOs as well as Linux. It allows for the automation of the building, testing, and deployment pipline.CodecovA service that generates a visual report of how much code has been tested. All configuration settings can be found in the codecov.yml file.AppveyorA service that can be used to test Windows. All configuration settings can be found in the appveyor.yml file.