Coder Social home page Coder Social logo

supy's Introduction

SuPy

Python Version Support Status Latest Version Status Downloads Launch Binder

Documentation Status DOI

SUEWS that speaks Python

Installation

SuPy requires 64-bit python 3.7+ and can be installed with pip in command line prompt:

python3 -m pip install supy --upgrade

Quick Demo

Once installed, supy can be quickly started to get SUEWS simulations done:

import supy as sp
import matplotlib.pyplot as plt

#load sample data
df_state_init, df_forcing = sp.load_SampleData()
grid = df_state_init.index[0]

#run supy/SUEWS simulation
df_output, df_state_end = sp.run_supy(df_forcing, df_state_init)

#plot results and save figure
res_plot = df_output.SUEWS.loc[grid, ['QN', 'QF', 'QS', 'QE', 'QH']]
ax=res_plot.loc['2012 6 4':'2012 6 6'].resample('30T').mean().plot()
plt.show()
ax.figure.savefig('sample_plot.png')

The above code will produce a plot of surface energy balance components as follows:

sample plot

Tutorial

Please check out more SuPy tutorials here!

Installation of the development version of SuPy

The development version supy includes both the supy wrapper and its kernel supy-driver - the calculation kernel written in Fortran.

All below is supposed to be in a directory named supy-dev - which however you can change.

  1. Get both the source code of SUEWS and SuPy

the development version of SuPy.

# get the source code of SUEWS and SuPy
git clone [email protected]:UMEP-dev/SUEWS.git

git clone [email protected]:UMEP-dev/SuPy.git
  1. Set up the conda environment
conda env create -f SuPy/env.yml
conda activate supy
  1. Install the dev version of SuPy
cd ../../SuPy

pip install -e src
  1. Compile the kernel supy-driver
cd SUEWS/supy-driver
make dev

Here you can check if supy-driver is installed correctly:

pip show supy-driver

note the location field in the output, which should point to the local supy-driver directory.

Note: after installing the development version of supy-driver, you might get the warning about incompatibility, which you can ignore and carry on. However, in case of any issue, please report it here.

  1. Check the version info of installed supy
pip show supy

note the location field in the output, which should point to the local supy directory.

supy's People

Contributors

sunt05 avatar hamidrezaomidvar avatar izzywillow avatar jkittner avatar dependabot-preview[bot] avatar xiaoxiongxie avatar matlipson avatar azure-pipelines[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.