This file contains 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
# This is a schematic script to enable cmake compilation with late versions of Xcode on a Mac | |
# This is the first problem: https://www.anaconda.com/blog/utilizing-the-new-compilers-in-anaconda-distribution-5 | |
# Other routes may be possible... | |
# We appear to need libomp and llvm alongside cmake, so | |
brew install cmake libomp llvm | |
# 1. Grab MacOSX10.9.sdk from https://github.com/phracker/MacOSX-SDKs and stick it in /opt/MacOSX10.9.sdk | |
# 2. Point the cmake compiler at this SDK |
This file contains 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
# Guaranteed for mac only due to syntax of sed function, but changes for | |
# other OS should be minor. | |
# Ensure you have sqlite3 on your machine. | |
# Remember to set unix permissions on this file before running: | |
# chmod 755 fix_html_xml.sh | |
# and run: | |
# ./fix_html_xml.sh | |
# This script should run clean! If you see errors, it won't have worked. | |
# Will probably take a while to run (mins) |
This file contains 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 requests | |
r = requests.get( | |
"https://api.github.com/search/issues", | |
params={ | |
"q": "fish+repo:SiccarPoint/stochastic-delta" | |
} # find the I am a fish issue | |
) | |
fishhue = r.json() | |
issue_url = fisshue['items'][0]['url'] # 0 index as only one issue has fish in it |
This file has been truncated, but you can view the full file.
This file contains 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
2016-10-06 16:53:23 +0100 | |
make | |
GDAL_DYNAMIC= | |
mkdir -p /private/tmp/grass-70-20161006-33138-1wldk1d/grass-7.0.4/dist.x86_64-apple-darwin15.6.0 | |
mkdir -p /private/tmp/grass-70-20161006-33138-1wldk1d/grass-7.0.4/bin.x86_64-apple-darwin15.6.0 | |
mkdir -p /private/tmp/grass-70-20161006-33138-1wldk1d/grass-7.0.4/dist.x86_64-apple-darwin15.6.0/include/grass | |
mkdir -p /private/tmp/grass-70-20161006-33138-1wldk1d/grass-7.0.4/dist.x86_64-apple-darwin15.6.0/lib | |
mkdir -p /private/tmp/grass-70-20161006-33138-1wldk1d/grass-7.0.4/dist.x86_64-apple-darwin15.6.0/bin |
This file contains 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
# #1: As a "run until" style: | |
# approach seems fiddly and annoying to me, but has advantage of always being general: | |
time_elapsed = 0. | |
dt = 5. # or whatever | |
while elapsed_time < total_time: | |
new_time = elapsed_time + dt | |
if new_time > total_time: | |
new_time = total_time - elapsed_time | |
my_component.run_component(new_time, *args, **kwds) |
This file contains 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
for (interval_duration, rainfall_rate) in precip.yield_storm_interstorm_duration_intensity(): | |
if rainfall_rate != 0.: | |
mg = fr.route_flow(grid=mg, runoff_rate=rainfall_rate) | |
#print 'Area: ', numpy.max(mg.at_node['drainage_area']) | |
mg,_,_ = sp.erode(mg, interval_duration, Q_if_used='water_discharges', K_if_used='K_values') | |
#add uplift | |
mg.at_node['topographic_elevation'][mg.core_nodes] += uplift*interval_duration | |
this_trunc = precip.elapsed_time//out_interval | |
if this_trunc != last_trunc: #a new loop round | |
print 'made it to loop ', out_interval*this_trunc |