diff --git a/README.md b/README.md index 74b8288..ab824d1 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ -SNAPIndices --- Alaska climate data -=================================== +AKIndices --- Alaska climate data +================================= Air temperature data from over 400 communities, reduced to relevant engineering parameters. What is it? ----------- -[SNAPIndices](http://snapindices.akdillon.net) is a Flask-driven web-app that builds on the SNAPExtract project to provide an easy-to-use interface for working with SNAP datasets. +[AKIndices](http://akindices.akdillon.net) is a Flask-driven web-app that builds on the AKExtract project to provide an easy-to-use interface for working with SNAP datasets. Prerequisites ------------- -- [SNAPExtract](http://github.com/thermokarst/snapextract) +- [AKExtract](http://github.com/thermokarst/akextract) - Flask (0.10.1) - SQLAlchemy (0.8.2) - psycopg2 (2.5.1) @@ -25,7 +25,7 @@ Installation 1) Clone the repo: - git clone https://github.com/thermokarst/snapindices + git clone https://github.com/thermokarst/akindices 2) Get the data from http://snap.uaf.edu @@ -34,8 +34,8 @@ Installation 4) Launch a python interpreter and populate the database with data: $ python - >>> import snapindices - >>> snapindices.database.init_db() + >>> import akindices + >>> akindices.database.init_db() 5) Launch the application with: @@ -46,4 +46,4 @@ Contact ------- Do you have an idea for a feature? Find a bug? -Reach me at [matthewrdillon@gmail.com](mailto:matthewrdillon@gmail.com) +Reach me at [mrdillon@alaska.edu](mailto:mrdillon@alaska.edu) diff --git a/snapindices/__init__.py b/akindices/__init__.py similarity index 95% rename from snapindices/__init__.py rename to akindices/__init__.py index ee25068..ac0846f 100644 --- a/snapindices/__init__.py +++ b/akindices/__init__.py @@ -17,4 +17,4 @@ if not application.debug: file_handler.setFormatter(logging.Formatter(format)) application.logger.addHandler(file_handler) -from snapindices import views +from akindices import views diff --git a/snapindices/database.py b/akindices/database.py similarity index 95% rename from snapindices/database.py rename to akindices/database.py index e1fe920..9f304cd 100644 --- a/snapindices/database.py +++ b/akindices/database.py @@ -3,7 +3,7 @@ from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.ext.declarative import declarative_base -from snapindices import application +from akindices import application import os engine = create_engine(application.config['ENGINE'], @@ -18,7 +18,7 @@ Base.query = db_session.query_property() def init_db(): tempsnap = application.config['SNAPDATA'] - import snapextract + import akextract import numpy import models import datetime @@ -52,7 +52,7 @@ def init_db(): Base.metadata.create_all(bind=engine) for filename in datafiles: - dataset = snapextract.GeoRefData(os.path.join(tempsnap, filename)) + dataset = akextract.GeoRefData(os.path.join(tempsnap, filename)) tokens = filename.split('_') startyr = int(tokens[-2]) endyr = int(tokens[-1].split('.')[0]) @@ -91,7 +91,7 @@ def init_db(): time_years = max_year - min_year + 1 i = 0 for community in communities: - longitude, latitude, elev = snapextract.ne_to_wgs(northings[i], eastings[i]) + longitude, latitude, elev = akextract.ne_to_wgs(northings[i], eastings[i]) location = models.Community.as_unique(db_session, name=community, northing=northings[i], easting=eastings[i], diff --git a/snapindices/forms.py b/akindices/forms.py similarity index 90% rename from snapindices/forms.py rename to akindices/forms.py index 7c59768..d63787a 100644 --- a/snapindices/forms.py +++ b/akindices/forms.py @@ -3,10 +3,10 @@ from flask_wtf import Form from wtforms import validators, ValidationError, IntegerField from wtforms.ext.sqlalchemy.fields import QuerySelectField -from snapindices.models import Community, Dataset, Temperature +from akindices.models import Community, Dataset, Temperature from sqlalchemy import func -class SNAPYearField(IntegerField): +class AKIYearField(IntegerField): def pre_validate(self, form): if form.model.data is not None: ymin,ymax = Temperature.query \ @@ -31,16 +31,16 @@ def dataset_names(ds): .capitalize(), resolution=ds.resolution) -class SNAPForm(Form): +class AKIForm(Form): community = QuerySelectField(query_factory=communities, get_label='name', allow_blank=True, blank_text=u'---Select a community---', validators=[validators.Required(message='Please select a community')]) - minyear = SNAPYearField(u'minyear') + minyear = AKIYearField(u'minyear') - maxyear = SNAPYearField(u'maxyear') + maxyear = AKIYearField(u'maxyear') model = QuerySelectField(query_factory=datasets, get_label=dataset_names, diff --git a/snapindices/models.py b/akindices/models.py similarity index 99% rename from snapindices/models.py rename to akindices/models.py index d15b7b5..69ea58a 100644 --- a/snapindices/models.py +++ b/akindices/models.py @@ -3,7 +3,7 @@ from sqlalchemy import Column, ForeignKey, Integer, Float, String, DateTime, create_engine from sqlalchemy.orm import relationship, backref from sqlalchemy.schema import Index -from snapindices.database import Base +from akindices.database import Base class UniqueMixin(object): diff --git a/snapindices/processing.py b/akindices/processing.py similarity index 100% rename from snapindices/processing.py rename to akindices/processing.py diff --git a/snapindices/static/css/BOOTSTRAP_LICENSE b/akindices/static/css/BOOTSTRAP_LICENSE similarity index 100% rename from snapindices/static/css/BOOTSTRAP_LICENSE rename to akindices/static/css/BOOTSTRAP_LICENSE diff --git a/snapindices/static/css/snapindices.css b/akindices/static/css/akindices.css similarity index 100% rename from snapindices/static/css/snapindices.css rename to akindices/static/css/akindices.css diff --git a/snapindices/static/css/bootstrap-readable.min.css b/akindices/static/css/bootstrap-readable.min.css similarity index 100% rename from snapindices/static/css/bootstrap-readable.min.css rename to akindices/static/css/bootstrap-readable.min.css diff --git a/snapindices/static/fonts/glyphicons-halflings-regular.eot b/akindices/static/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from snapindices/static/fonts/glyphicons-halflings-regular.eot rename to akindices/static/fonts/glyphicons-halflings-regular.eot diff --git a/snapindices/static/fonts/glyphicons-halflings-regular.svg b/akindices/static/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from snapindices/static/fonts/glyphicons-halflings-regular.svg rename to akindices/static/fonts/glyphicons-halflings-regular.svg diff --git a/snapindices/static/fonts/glyphicons-halflings-regular.ttf b/akindices/static/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from snapindices/static/fonts/glyphicons-halflings-regular.ttf rename to akindices/static/fonts/glyphicons-halflings-regular.ttf diff --git a/snapindices/static/fonts/glyphicons-halflings-regular.woff b/akindices/static/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from snapindices/static/fonts/glyphicons-halflings-regular.woff rename to akindices/static/fonts/glyphicons-halflings-regular.woff diff --git a/snapindices/static/js/bootstrap.min.js b/akindices/static/js/bootstrap.min.js similarity index 100% rename from snapindices/static/js/bootstrap.min.js rename to akindices/static/js/bootstrap.min.js diff --git a/snapindices/templates/404.html b/akindices/templates/404.html similarity index 100% rename from snapindices/templates/404.html rename to akindices/templates/404.html diff --git a/snapindices/templates/500.html b/akindices/templates/500.html similarity index 100% rename from snapindices/templates/500.html rename to akindices/templates/500.html diff --git a/snapindices/templates/_formhelpers.html b/akindices/templates/_formhelpers.html similarity index 100% rename from snapindices/templates/_formhelpers.html rename to akindices/templates/_formhelpers.html diff --git a/snapindices/templates/base.html b/akindices/templates/base.html similarity index 87% rename from snapindices/templates/base.html rename to akindices/templates/base.html index 8bb4f44..3bc8eda 100644 --- a/snapindices/templates/base.html +++ b/akindices/templates/base.html @@ -3,7 +3,7 @@ {{title}} - + @@ -21,8 +21,7 @@