Skip to content

Commit

Permalink
Merge branch 'release/1.24.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
rbreslow committed Mar 4, 2019
2 parents fc8d1b0 + fecf326 commit 5fdf2d7
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ target/

# Ansible
deployment/ansible/roles/azavea.*
*.retry

# CloudFormation
deployment/default.yml
Expand Down
3 changes: 2 additions & 1 deletion deployment/ansible/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ postgresql_database: mmw
postgresql_version: "9.4"
postgresql_package_version: "9.4.*.pgdg14.04+1"
postgresql_support_repository_channel: "main"
postgresql_support_libpq_version: "11.1-1.pgdg14.04+1"
postgresql_support_libpq_version: "11.*.pgdg14.04+1"
postgresql_support_psycopg2_version: "2.7"
postgis_version: "2.2"
postgis_package_version: "2.2.*.pgdg14.04+1"
Expand Down Expand Up @@ -60,5 +60,6 @@ observation_api_url: "http://www.wikiwatershed-vs.org/"
enabled_features: ''

numba_version: "0.38.1"
numpy_version: "1.14.5"

redis_version: "2:2.8.4-2ubuntu0.2"
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
- name: Install numba
pip: name=numba version={{ numba_version }}

- name: Install numpy
pip: name=numpy version={{ numpy_version }}

- name: Install application Python dependencies for development and test
pip: requirements="{{ app_home }}/requirements/{{ item }}.txt"
with_items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@

- name: Enable Celery service
service: name=celeryd enabled=yes state=started

- name: Setup daily Celery service restart
cron:
name: celery-restart
special_time: daily
job: service celeryd restart
state: present
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
- name: Install numba
pip: name=numba version={{ numba_version }}

- name: Install numpy
pip: name=numpy version={{ numpy_version }}

- name: Install application Python dependencies for development and test
pip: requirements="{{ app_home }}/requirements/{{ item }}.txt"
with_items:
Expand Down
2 changes: 1 addition & 1 deletion deployment/packer/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"sleep 5",
"sudo apt-get update -qq",
"sudo apt-get install python-pip python-dev -y",
"sudo pip install --upgrade pip",
"sudo pip install --upgrade pip==18.1",
"sudo pip install ansible==2.4.4.0",
"sudo /bin/sh -c 'echo {{user `branch`}} {{user `description`}} > /srv/version.txt'"
]
Expand Down
2 changes: 1 addition & 1 deletion deployment/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ansible==2.4.4.0
majorkirby>=0.2.0,<0.2.99
troposphere>=1.1.0
troposphere==1.1.0
boto==2.39.0
awscli>=1.9.15
5 changes: 2 additions & 3 deletions src/mmw/apps/core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,14 @@ def save_job_error(request, exc, traceback, job_id):
try:
job = Job.objects.get(id=job_id)
job.error = exc
job.traceback = traceback
job.traceback = traceback or 'No traceback'
job.delivered_at = now()
job.status = 'failed'
job.save()
except Exception as e:
logger.error('Failed to save job error status. Job will appear hung. \
Job Id: {0}'.format(job.id))
logger.error('Error number: {0} - Error: {1}'
.format(e.errno, e.strerror))
logger.error('Error: {}'.format(e))


@shared_task(bind=True)
Expand Down
4 changes: 4 additions & 0 deletions src/mmw/js/src/core/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,9 @@ nunjucks.env.addFilter('toFriendlyBytes', function(bytes) {
});

nunjucks.env.addFilter('toUnit', function(value, unit) {
if (!unit) {
return value;
}

return coreUnits.get(unit, value).value;
});
10 changes: 10 additions & 0 deletions src/mmw/js/src/core/units.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ var units = {
factor: 2.83168E-02,
offset: 0
},
PERCENT: {
name: '%',
factor: 1,
offset: 0
},
},
METRIC: {
AREA_XL: {
Expand Down Expand Up @@ -170,6 +175,11 @@ var units = {
factor: 1,
offset: 0
},
PERCENT: {
name: '%',
factor: 1,
offset: 0
},
},
get: function(unit, value) {
var scheme = settings.get('unit_scheme');
Expand Down
4 changes: 2 additions & 2 deletions src/mmw/js/src/modeling/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,8 @@ var PrecipitationView = ControlView.extend({
// Update values for IE which doesn't trigger onSliderDragged. Will
// effectively noop on other browsers, since the same values were
// already set by onSliderDragged.
this.ui.slider.attr('value', value);
this.ui.displayValue.text(this.getDisplayValue(value));
this.ui.slider.attr('value', sliderValue);
this.ui.displayValue.text(this.getDisplayValue(sliderValue));

this.addOrReplaceInput(modification);
},
Expand Down
9 changes: 6 additions & 3 deletions src/mmw/js/src/modeling/gwlfe/entry/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,15 @@ var FieldView = Marionette.ItemView.extend({
var value = this.ui.input.val(),
unit = this.model.get('unit');

if (unit) {
// Treat empty string as null
if (value === '') {
value = null;
} else if (unit) {
// Convert user preferred unit into underlying representation
value /= coreUnits.get(unit, 1).value;
}

this.model.set('userValue', value || null);
this.model.set('userValue', value);
this.toggleUserValueState();
},

Expand All @@ -357,7 +360,7 @@ var FieldView = Marionette.ItemView.extend({
toggleUserValueState: function() {
var userValue = this.model.get('userValue');

if (userValue) {
if (userValue !== null) {
this.$el.addClass('has-user-value');
} else {
this.$el.removeClass('has-user-value');
Expand Down
3 changes: 3 additions & 0 deletions src/mmw/js/src/modeling/gwlfeModificationConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ function fromPairs(pairs) {
}

var displayUnits = fromPairs([
[percentAeuToModifyName, 'PERCENT'],
[percentAreaToModifyName, 'PERCENT'],
[areaToModifyName, 'AREA_L_FROM_HA'],
[lengthToModifyName, 'LENGTH_XL_FROM_KM'],
[lengthToModifyInAgName, 'LENGTH_XL_FROM_KM'],
Expand Down Expand Up @@ -295,6 +297,7 @@ function makeAgBmpConfig(outputName) {

function makeAeuBmpConfig(outputName) {
return {
unit: 'PERCENT',
dataModelNames: [],
validateDataModel: makeValidateDataModelFn([]),
userInputNames: [percentAeuToModifyName],
Expand Down
2 changes: 1 addition & 1 deletion src/mmw/mmw/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@
GOOGLE_MAPS_API_KEY = 'AIzaSyCXdkywU7rps_i1CeKqWxlBi97vyGeXsqk'

# Stroud account
GOOGLE_ANALYTICS_ACCOUNT = 'UA-47047573-7'
GOOGLE_ANALYTICS_ACCOUNT = 'UA-47047573-15'
2 changes: 0 additions & 2 deletions src/mmw/requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ https://bitbucket.org/jurko/suds/get/94664ddd46a6.tar.gz#egg=suds-jurko
django_celery_results==1.0.1
pandas==0.22.0
git+git://github.com/emiliom/ulmo@wml_values_md#egg=ulmo
numpy==1.14.5
hs_restclient==1.2.10
six==1.11.0
fiona==1.7.11
timeout-decorator==0.4.0
numba==0.38.1
redis==2.10.6

0 comments on commit 5fdf2d7

Please sign in to comment.