This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# NOTE: This version of this script was adapted from | |
# https://gist.github.com/FernFerret/3178035, with a few minor revisions | |
# for efficiency and clarity of output. | |
# This simple script will look at all named branches in a given repository | |
# and print out any branch that contains multiple open heads. This is useful | |
# to see if your repository is clean or if someone has pushed multiple | |
# anonymous branches. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run InVEST Autotest | |
steps: | |
windows-invest-autotest: | |
name: Run InVEST-autotest (windows) | |
needs: build-windows-binaries | |
runs-on: windows-latest | |
env: | |
PYTHON_VERSION: 3.7 | |
PYTHON_ARCH: x64 | |
steps: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A wrapper around the powershell equivalent of zipping functionality. | |
# This script takes 3 parameters: | |
# --> whether to recurse (this is ignored, but we have to take it anyways for compatibility) | |
# --> The target archive path | |
# --> The folder to zip. | |
# | |
param ( | |
[Parameter(Mandatory=$false, ValueFromPipeline=$false, ParameterSetName='r')] | |
[switch] | |
$recurse, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/setup.py b/setup.py | |
index 46be1b36..67b5a1df 100644 | |
--- a/setup.py | |
+++ b/setup.py | |
@@ -96,6 +96,8 @@ setup( | |
Extension( | |
name="natcap.invest.sdr.sdr_core", | |
sources=['src/natcap/invest/sdr/sdr_core.pyx'], | |
+ define_macros=[('CYTHON_TRACE', '1')], | |
+ compiler_directives={'linetrace': True}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import logging | |
logging.basicConfig(level=logging.DEBUG) | |
import pygeoprocessing | |
from osgeo import gdal | |
import numpy | |
def doit(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def doit(): | |
packed_flow_dir = int(sys.argv[1]) | |
weights = [(packed_flow_dir >> 4*i) & 0xF for i in range(8)] | |
weights = [str(w).rjust(2, ' ') for w in weights] | |
print(weights) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding=UTF-8 | |
"""time-mfd-aspect.py | |
Time MFD mean aspect ratio generation routine over 100 runs. | |
Requires: | |
- pygeoprocessing==1.9.2 | |
- git+https://github.com/phargogh/invest.git@8ac2575#egg=natcap.invest | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# jq -r prints the 'raw' value. | |
curl https://api.github.com/repos/natcap/invest.users-guide/commits/master | jq -r .sha |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REPO_DIR=$(pwd)/repos | |
OUT_DIR=$(pwd)/bundles | |
mkdir -p $OUT_DIR $REPO_DIR | |
for sshrepo in `cat repos.txt` | |
do | |
REPONAME=$(echo $sshrepo | cut -d '/' -f 5-) | |
TARGETDIR=$REPO_DIR/$REPONAME | |
hg clone $sshrepo --noupdate $TARGETDIR | |
pushd $OUT_DIR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: python model_stats.py <path to model stats GeoJSON | |
import sys | |
import collections | |
from osgeo import ogr | |
ALIASES = { | |
'natcap.invest.blue_carbon.blue_carbon_preprocessor': 'CBC-preprocessor', | |
'natcap.invest.coastal_blue_carbon.preprocessor': 'CBC-preprocessor', | |
'natcap.invest.coastal_blue_carbon.coastal_blue_carbon': 'CBC', |