From 35bb0c85ee04164ddbe97f19767db523c1406e9a Mon Sep 17 00:00:00 2001 From: Nathan Swain Date: Fri, 20 Jan 2023 16:20:34 -0700 Subject: [PATCH] Updates for Tethys 4.0 --- install.yml | 6 ++- setup.py | 8 ++-- tethysapp/earth_engine/__init__.py | 2 +- tethysapp/earth_engine/app.py | 30 +++--------- tethysapp/earth_engine/controllers.py | 9 ++-- tethysapp/earth_engine/handoff.py | 3 -- tethysapp/earth_engine/public/css/main.css | 2 +- tethysapp/earth_engine/public/css/map.css | 2 +- tethysapp/earth_engine/public/images/icon.gif | Bin 14125 -> 0 bytes .../earth_engine/public/js/gee_datasets.js | 32 ++++++------- .../templates/earth_engine/base.html | 20 ++++---- .../templates/earth_engine/home.html | 10 ++-- tethysapp/earth_engine/tests/tests.py | 44 ++++++------------ 13 files changed, 67 insertions(+), 101 deletions(-) delete mode 100644 tethysapp/earth_engine/handoff.py delete mode 100644 tethysapp/earth_engine/public/images/icon.gif diff --git a/install.yml b/install.yml index 3a9e48e..e4deb55 100644 --- a/install.yml +++ b/install.yml @@ -1,5 +1,7 @@ # This file should be committed to your app code. version: 1.0 +# This should be greater or equal to your tethys-platform in your environment +tethys_version: ">=4.0.0" # This should match the app - package name in your setup.py name: earth_engine @@ -14,4 +16,6 @@ requirements: - oauth2client pip: -post: + npm: + +post: \ No newline at end of file diff --git a/setup.py b/setup.py index 90a817f..7f32563 100644 --- a/setup.py +++ b/setup.py @@ -1,16 +1,16 @@ from setuptools import setup, find_namespace_packages -from tethys_apps.app_installation import find_resource_files +from tethys_apps.app_installation import find_all_resource_files +from tethys_apps.base.app_base import TethysAppBase # -- Apps Definition -- # app_package = 'earth_engine' -release_package = 'tethysapp-' + app_package +release_package = f'{TethysAppBase.package_namespace}-{app_package}' # -- Python Dependencies -- # dependencies = [] # -- Get Resource File -- # -resource_files = find_resource_files('tethysapp/' + app_package + '/templates', 'tethysapp/' + app_package) -resource_files += find_resource_files('tethysapp/' + app_package + '/public', 'tethysapp/' + app_package) +resource_files = find_all_resource_files(app_package, TethysAppBase.package_namespace) setup( diff --git a/tethysapp/earth_engine/__init__.py b/tethysapp/earth_engine/__init__.py index 8766881..c927d02 100644 --- a/tethysapp/earth_engine/__init__.py +++ b/tethysapp/earth_engine/__init__.py @@ -1 +1 @@ -# Included for native namespace package support \ No newline at end of file +# Included for native namespace package support diff --git a/tethysapp/earth_engine/app.py b/tethysapp/earth_engine/app.py index 660567e..d368756 100644 --- a/tethysapp/earth_engine/app.py +++ b/tethysapp/earth_engine/app.py @@ -1,4 +1,4 @@ -from tethys_sdk.base import TethysAppBase, url_map_maker +from tethys_sdk.base import TethysAppBase class EarthEngine(TethysAppBase): @@ -6,29 +6,13 @@ class EarthEngine(TethysAppBase): Tethys app class for Earth Engine. """ - name = 'Earth Engine' - index = 'earth_engine:home' - icon = 'earth_engine/images/earth-engine-logo.png' - package = 'earth_engine' + name = 'Google Earth Engine Tutorial' + description = '' + package = 'earth_engine' # WARNING: Do not change this value + index = 'home' + icon = f'{package}/images/earth-engine-logo.png' root_url = 'earth-engine' color = '#524745' - description = '' tags = '' enable_feedback = False - feedback_emails = [] - - def url_maps(self): - """ - Add controllers - """ - UrlMap = url_map_maker(self.root_url) - - url_maps = ( - UrlMap( - name='home', - url='earth-engine', - controller='earth_engine.controllers.home' - ), - ) - - return url_maps \ No newline at end of file + feedback_emails = [] \ No newline at end of file diff --git a/tethysapp/earth_engine/controllers.py b/tethysapp/earth_engine/controllers.py index ad23d24..4ff96cd 100644 --- a/tethysapp/earth_engine/controllers.py +++ b/tethysapp/earth_engine/controllers.py @@ -1,11 +1,12 @@ import datetime as dt from django.shortcuts import render -from tethys_sdk.permissions import login_required -from tethys_sdk.gizmos import SelectInput, DatePicker, Button, MapView, MVView +from tethys_sdk.routing import controller +from tethys_sdk.gizmos import SelectInput, DatePicker, Button +from tethys_sdk.gizmos import MapView, MVView from .gee.products import EE_PRODUCTS -@login_required() +@controller def home(request): """ Controller for the app home page. @@ -112,7 +113,7 @@ def home(request): load_button = Button( name='load_map', display_text='Load', - style='default', + style='outline-secondary', attributes={'id': 'load_map'} ) diff --git a/tethysapp/earth_engine/handoff.py b/tethysapp/earth_engine/handoff.py deleted file mode 100644 index 1e15fb8..0000000 --- a/tethysapp/earth_engine/handoff.py +++ /dev/null @@ -1,3 +0,0 @@ -# Define your handoff handlers here -# for more information, see: -# http://docs.tethysplatform.org/en/dev/tethys_sdk/handoff.html \ No newline at end of file diff --git a/tethysapp/earth_engine/public/css/main.css b/tethysapp/earth_engine/public/css/main.css index b2b732d..be9379d 100644 --- a/tethysapp/earth_engine/public/css/main.css +++ b/tethysapp/earth_engine/public/css/main.css @@ -1,4 +1,4 @@ /* Remove padding on bottom where app-actions section used to be */ #app-content-wrapper #app-content { padding-bottom: 0; -} +} \ No newline at end of file diff --git a/tethysapp/earth_engine/public/css/map.css b/tethysapp/earth_engine/public/css/map.css index 6d72cbb..7a0907e 100644 --- a/tethysapp/earth_engine/public/css/map.css +++ b/tethysapp/earth_engine/public/css/map.css @@ -6,4 +6,4 @@ #inner-app-content { height: 100%; padding: 0; -} +} \ No newline at end of file diff --git a/tethysapp/earth_engine/public/images/icon.gif b/tethysapp/earth_engine/public/images/icon.gif deleted file mode 100644 index 5c8236e97d2adfe5a66e7bed323cd70d223576d4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14125 zcmb80)msz{u*R2OVA-WRmPWdzSwIB=l~9ykke2Rd>2B%n5?C537o@wpyHjc8eCPZJ zXD;Syp69)ot9O3$D!zRqCT?VpVUN)b0G$85r?Re64FA zA9dJsk2%|{xmTTepFN{;?UlHxWBUso2dpJ>#!H=*D|M>pf4B~vc>Y>Px~uYLjP2KZ zj@Y)Yoi}^GuUbJXLoP^;PB}9iAuCz4XgYPr9rpf47x5JCI4ws0VkL-VlG|9WD>lu?M6J({!^SQAGeOu0&1|hjr88bm;=+Eae8Pv2=k*JTYWFS1$maR*DXQ zDqpCxm{P`q2^C|Yp|uUN?kAvzF|Do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=+K2iY2iefzSDVKp90*ee1TCfdzs zi-RQ$UzL3Y!w`$Qh?AAuSf*zLQ1f1Xk1Pc|UPCeP5VlD}ZMfUE;^>C-S7}GfxWBWT zA2_qGvhbg9ao~3t4$m@w3S0Ac?-g1mbN)pD;vWC|Y>=3)&c49Dm9oRV6`TFl5skr( z+SUB}Uo-}MU9Z@Mrt?y7j;`vunWA7HdtI!F5RO34)j#!a3PSHSaMVIW9YfDrH`XrP zurX!62FbQ<`CQ(#G~u1$b3AVG#l~YGpQbpeVHmVXx8X>7dh{;{v_^v*OiDP~9DVx{ z9}@sQv!fOp3Oh24^=kbO{$z$m?P=#ctcUIcYF@(58UzuG_|QLHb{$q>9{{U-G9B4X z(pOorKG#6#b(^A(1hLxFiMih+Jw5_J3j?5o;D9MUEWm7zFAflOxLy6+9AA12k`6%@Bsq_I0A)~0!1tWUxo#Wmj+7q2TJb;$^wJr zID!= date_evd && date_csd <= date_lvd && date_ced >= date_evd && date_ced <= date_lvd) { reset_current_dates = false; } - + // Update start date datepicker bounds $('#start_date').datepicker('setStartDate', earliest_valid_date); $('#start_date').datepicker('setEndDate', latest_valid_date); @@ -174,7 +173,7 @@ var GEE_DATASETS = (function() { $('#start_date').datepicker('update', INITIAL_START_DATE); m_start_date = INITIAL_START_DATE; } - + // Update end date datepicker bounds $('#end_date').datepicker('setStartDate', earliest_valid_date); $('#end_date').datepicker('setEndDate', latest_valid_date); @@ -182,7 +181,7 @@ var GEE_DATASETS = (function() { $('#end_date').datepicker('update', INITIAL_END_DATE); m_end_date = INITIAL_END_DATE; } - + console.log('Date Bounds Changed To: ' + earliest_valid_date + ' - ' + latest_valid_date); }; @@ -198,7 +197,6 @@ var GEE_DATASETS = (function() { return data; }; - /************************************************************************ * PUBLIC INTERFACE *************************************************************************/ @@ -225,4 +223,4 @@ var GEE_DATASETS = (function() { return public_interface; -}()); // End of package wrapper +}()); // End of package wrapper \ No newline at end of file diff --git a/tethysapp/earth_engine/templates/earth_engine/base.html b/tethysapp/earth_engine/templates/earth_engine/base.html index 5dc873e..2c1e6d2 100644 --- a/tethysapp/earth_engine/templates/earth_engine/base.html +++ b/tethysapp/earth_engine/templates/earth_engine/base.html @@ -13,16 +13,16 @@ {% block app_title %}{{ tethys_app.name }}{% endblock %} {% block app_navigation_items %} -
  • App Navigation
  • -
  • Home
  • -
  • Jobs
  • -
  • Results
  • -
  • Steps
  • -
  • 1. The First Step
  • -
  • 2. The Second Step
  • -
  • 3. The Third Step
  • -
  • -
  • Get Started
  • + + + + + + + + + + {% endblock %} {% block app_content %} diff --git a/tethysapp/earth_engine/templates/earth_engine/home.html b/tethysapp/earth_engine/templates/earth_engine/home.html index e5b7455..d9043e8 100644 --- a/tethysapp/earth_engine/templates/earth_engine/home.html +++ b/tethysapp/earth_engine/templates/earth_engine/home.html @@ -1,11 +1,6 @@ {% extends "earth_engine/base.html" %} {% load tethys_gizmos static %} -{% block content_dependent_styles %} - {{ block.super }} - -{% endblock %} - {% block app_navigation_items %}
  • Select Dataset
  • {% gizmo platform_select %} @@ -31,3 +26,8 @@ {{ block.super }} {% endblock %} + +{% block content_dependent_styles %} + {{ block.super }} + +{% endblock %} \ No newline at end of file diff --git a/tethysapp/earth_engine/tests/tests.py b/tethysapp/earth_engine/tests/tests.py index e3e1e4e..24d629d 100644 --- a/tethysapp/earth_engine/tests/tests.py +++ b/tethysapp/earth_engine/tests/tests.py @@ -1,24 +1,19 @@ # Most of your test classes should inherit from TethysTestCase from tethys_sdk.testing import TethysTestCase -# Use if your app has persistent stores that will be tested against. -# Your app class from app.py must be passed as an argument to the TethysTestCase functions to both -# create and destroy the temporary persistent stores for your app used during testing -# from ..app import EarthEngine - -# Use if you'd like a simplified way to test rendered HTML templates. -# You likely need to install BeautifulSoup, as it is not included by default in Tethys Platform -# 1. Open a terminal -# 2. Enter command ". /usr/lib/tethys/bin/activate" to activate the Tethys python environment -# 3. Enter command "pip install beautifulsoup4" -# For help, see https://www.crummy.com/software/BeautifulSoup/bs4/doc/ +# For testing rendered HTML templates it may be helpful to use BeautifulSoup. # from bs4 import BeautifulSoup +# For help, see https://www.crummy.com/software/BeautifulSoup/bs4/doc/ + """ -To run any tests: - 1. Open a terminal - 2. Enter command ". /usr/lib/tethys/bin/activate" to activate the Tethys python environment - 3. In portal_config.yml make sure that the default database user is set to tethys_super or is a super user of the database +To run tests for an app: + + 1. Open a terminal and activate the Tethys environment:: + + conda activate tethys + + 2. In portal_config.yml make sure that the default database user is set to tethys_super or is a super user of the database DATABASES: default: ENGINE: django.db.backends.postgresql_psycopg2 @@ -28,28 +23,15 @@ HOST: 127.0.0.1 PORT: 5435 - 4. Enter tethys test command. - The general form is: "tethys test -f tethys_apps.tethysapp....." - See below for specific examples - - To run all tests across this app: - Test command: "tethys test -f tethys_apps.tethysapp.earth_engine" + 3. From the root directory of your app, run the ``tethys manage test`` command:: - To run all tests in this file: - Test command: "tethys test -f tethys_apps.tethysapp.earth_engine.tests.tests" + tethys manage test tethysapp//tests - To run tests in the EarthEngineTestCase class: - Test command: "tethys test -f tethys_apps.tethysapp.earth_engine.tests.tests.EarthEngineTestCase" - - To run only the test_if_tethys_platform_is_great function in the EarthEngineTestCase class: - Test command: "tethys test -f tethys_apps.tethysapp.earth_engine.tests.tests.EarthEngineTestCase.test_if_tethys_platform_is_great" To learn more about writing tests, see: - https://docs.djangoproject.com/en/1.9/topics/testing/overview/#writing-tests - https://docs.python.org/2.7/library/unittest.html#module-unittest + https://docs.tethysplatform.org/en/stable/tethys_sdk/testing.html """ - class EarthEngineTestCase(TethysTestCase): """ In this class you may define as many functions as you'd like to test different aspects of your app.