Python interface to SyncroSim
Project description
pysyncrosim ![](https://pypi-camo.freetls.fastly.net/b36b079adbbd1401e813ce17b53b4cbb23e84d3f/646f63732f696d672f6c6f676f2e706e67)
The Python interface to SyncroSim
Installation
pysyncrosim
can be installed using either the conda
or pip
package managers. conda
is a general package manager capable of installing packages from many sources, but pip
is strictly a Python package manager. While the installation instructions below are based on a Windows 10 operating system, similar steps can be used to install pysyncrosim
for Linux.
Before beginning the installation of pysyncrosim
, make sure you have the latest release of SyncroSim installed.
Dependencies
pysyncrosim
was tested and developed using Python 3.8 and SyncroSim 2.3.5. Because pysyncrosim
uses rasterio
for integrating spatial data, it also requires a C library dependency: GDAL >=2.3.
python>=3.8
pandas=1.3.2
numpy=1.21.2
rasterio>=1.2.6
Using conda
Follow these steps to get started with conda
and use conda
to install pysyncrosim
.
-
Install
conda
using the Miniconda or Anaconda installer (in this tutorial we use Miniconda). To install Miniconda, follow this link and under the Latest Miniconda Installer Links, download Miniconda for your operating system. Open the Miniconda installer and follow the default steps to installconda
. For more information, see the conda documentation. -
To use
conda
, open the command prompt that was installed with the Miniconda installer. To find this prompt, type "anaconda prompt" in the Windows Search Bar. You should see an option appear called Anaconda Prompt (miniconda3). Select this option to open a command line window. All code in the next steps will be typed in this window. -
You can either install
pysyncrosim
and its dependencies into your base environment, or set up a newconda
environment (recommended). Run the code below to set up and activate a newconda
environment called "myenv" that uses Python 3.8.
# Create new conda environment
conda create -n myenv python=3.8
# Activate environment
conda activate myenv
You should now see that "(base)" has been replaced with "(myenv)" at the beginning of each prompt.
- Set the package channel for
conda
. To be able to install the dependencies forpysyncrosim
, you need to access theconda-forge
package channel. To configure this channel, run the following code in the Anaconda Prompt.
# Set conda-forge package channel
conda config --add channels conda-forge
- Install
pysyncrosim
usingconda install
. Installingpysyncrosim
will also install its dependencies:pandas
,numpy
, andrasterio
.
# Install pysyncrosim
conda install pysyncrosim
pysyncrosim
should now be installed and ready to use!
Using pip
Use pip
to install pysyncrosim
to your default python installation. You can install Python from https://www.python.org/downloads/. You can also find information on how to install pip
from the pip documentation.
Install pysyncrosim
using pip install
. Installing pysyncrosim
will also install its dependencies: pandas
, numpy
, and rasterio
.
# Make sure you are using the latest version of pip
pip install --upgrade pip
# Install pysyncrosim
pip install pysyncrosim
Usage
Getting Started
For a basic usage example with the helloworldSpatial package, see the spatial_demo.py and input-raster.tif in the examples folder. To download the spatial_demo.py file, view the file on GitHub and select Raw. From the raw view, right-click and select Save As.... To run the spatial demo, you will also need to install the matplotlib
Python package. You can install this package using the following code.
# Install matplotlib
conda install matplotlib
Running pysyncrosim in Spyder
If using conda
, the spyder
IDE is easy to install and straightforward to use.
- First, install
spyder
either in your base environment or in yourconda
environment using the following code.
# Install spyder
conda install spyder
- Open the IDE by typing
spyder
in the command prompt.
# Open spyder
spyder
Note: you may get a pop-up saying you have a missing dependency, rtree
. You can safely ignore this warning.
- Within the IDE, change the working directory to the directory containing your
pysyncrosim
scripts (e.g. spatial_demo.py and input-raster.tif)
- Open and run your
pysyncrosim
scripts from the left-hand window. You can run scripts line-by-line inspyder
by selecting the line(s) you want to run and pressing F9.
SyncroSim Package Development
If you wish to design SyncroSim packages using python and pysyncrosim
, you can follow the Creating a Package and Enhancing a Package tutorials on the SyncroSim documentation website. Note that SyncroSim v2.3.6 is required to develop python-based SyncroSim packages.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pysyncrosim-1.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9dd4023e6af2abe97803b95220abc479d9e307dc70af485f157416a037fb457 |
|
MD5 | a1ec1a10ba4fbac6f839204696f55bc9 |
|
BLAKE2b-256 | 0ceb1562ba1de0e54ef911ecee28e41d47c96f3ab49fb5124c063b6ac74091e8 |