Skip to content

Commit

Permalink
Update py template
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Jun 15, 2020
1 parent 55e6c7b commit 70bd297
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 51 deletions.
40 changes: 12 additions & 28 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,21 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
release:
types: [created]

jobs:
# release:
# name: Create Release
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@master
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# body: |
# Changes in this Release
# draft: false
# prerelease: false
deploy:
needs: release

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
Expand All @@ -40,8 +24,8 @@ jobs:
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERS}}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD}}
TWINE_USERNAME: ${{ secrets.PYPI_USERS }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
twine upload dist/*
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
=======
History
=======
0.7.0 (2020-05-22)
------------------
0.6.0 (2020-04-05)
------------------
0.5.0 (2020-03-24)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@
"import geemap"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Map = geemap.Map()\n",
"Map"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
11 changes: 5 additions & 6 deletions geemap/data/template/template.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
"# Checks whether this notebook is running on Google Colab\n",
"try:\n",
" import google.colab\n",
" import geemap.eefolium as emap\n",
" import geemap.eefolium as geemap\n",
"except:\n",
" import geemap as emap\n",
" import geemap\n",
"\n",
"# Authenticates and initializes Earth Engine\n",
"import ee\n",
Expand All @@ -59,7 +59,7 @@
"metadata": {},
"source": [
"## Create an interactive map \n",
"The default basemap is `Google Satellite`. [Additional basemaps](https://github.com/giswqs/geemap/blob/master/geemap/geemap.py#L13) can be added using the `Map.add_basemap()` function. "
"The default basemap is `Google Satellite`. [Additional basemaps](https://github.com/giswqs/geemap/blob/master/geemap/basemaps.py) can be added using the `Map.add_basemap()` function. "
]
},
{
Expand All @@ -68,8 +68,7 @@
"metadata": {},
"outputs": [],
"source": [
"Map = emap.Map(center=[40,-100], zoom=4)\n",
"# Map.add_basemap('ROADMAP') # Add Google Map\n",
"Map = geemap.Map(center=[40,-100], zoom=4)\n",
"Map"
]
},
Expand Down Expand Up @@ -162,4 +161,4 @@
},
"nbformat": 4,
"nbformat_minor": 1
}
}
9 changes: 4 additions & 5 deletions geemap/data/template/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
# Checks whether this notebook is running on Google Colab
try:
import google.colab
import geemap.eefolium as emap
import geemap.eefolium as geemap
except:
import geemap as emap
import geemap

# Authenticates and initializes Earth Engine
import ee
Expand All @@ -45,12 +45,11 @@
# %%
"""
## Create an interactive map
The default basemap is `Google Satellite`. [Additional basemaps](https://github.com/giswqs/geemap/blob/master/geemap/geemap.py#L13) can be added using the `Map.add_basemap()` function.
The default basemap is `Google Maps`. [Additional basemaps](https://github.com/giswqs/geemap/blob/master/geemap/basemaps.py) can be added using the `Map.add_basemap()` function.
"""

# %%
Map = emap.Map(center=[40,-100], zoom=4)
# Map.add_basemap('ROADMAP') # Add Google Map
Map = geemap.Map(center=[40,-100], zoom=4)
Map

# %%
Expand Down
6 changes: 4 additions & 2 deletions geemap/geemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -4930,16 +4930,18 @@ def build_repo_tree(out_dir=None, name='gee_repos'):
path_widget.layout.width = '475px'
clone_widget = widgets.Button(
description='Clone', button_style='primary', tooltip='Clone the repository to folder.')
# clone_widget.layout.width = '100px'
info_widget = widgets.HBox()
# info_widget.children = [path_widget, clone_widget]

groups = ['Owner', 'Writer', 'Reader', 'Examples', 'Archive']
for group in groups:
group_dir = os.path.join(repo_dir, group)
if not os.path.exists(group_dir):
os.makedirs(group_dir)

example_dir = os.path.join(repo_dir, 'Examples/earthengine-py-examples')
if not os.path.exists(example_dir):
clone_github_repo(URLs['Examples'], out_dir=example_dir)

left_widget, right_widget, tree_dict = file_browser(
in_dir=repo_dir, add_root_node=False, search_description='Filter scripts...', use_import=True, return_sep_widgets=True)
info_widget.children = [right_widget]
Expand Down

0 comments on commit 70bd297

Please sign in to comment.