Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in converting a commented out function #136

Closed
profLewis opened this issue Aug 27, 2020 · 2 comments
Closed

bug in converting a commented out function #136

profLewis opened this issue Aug 27, 2020 · 2 comments

Comments

@profLewis
Copy link

  • geemap version:
    geemap.version_info -> (0, 13, 3)

  • Python version:
    Python 3.6.10 :: Anaconda, Inc.

  • Operating System:
    Darwin Kernel Version 19.6.0

Description

Trying to do:
Use js_to_python from geemap.conversion to convert a javascript gee code

Tell us what happened, what went wrong, and what you expected to happen:

bug in converting a commented out function

The js line:

// var s2_cloud = function(image){

gets converted to

def # s2_cloud(image):

See below. for run

What I Did

  • setup googlesource login to allow pull of earth engine public repos

  • clone example code

git clone https://earthengine.googlesource.com/users/marcyinfeng/utils
cd utils

  • example python code: example.py
from pathlib import Path        
from geemap.conversion import *

jsfile = 'SIAC_lai_accurate'
infile   = Path(jsfile).absolute().as_posix() 
outfile =  Path(jsfile + '.py').absolute().as_posix() 
retcode = js_to_python(infile,outfile)
  • run conversion
    python example.py
  • test result
    python SIAC_lai_accurate.py
    result:
File "SIAC_lai_accurate.py", line 51
   def # s2_cloud(image):
                        ^
SyntaxError: invalid syntax
giswqs added a commit that referenced this issue Aug 27, 2020
@giswqs
Copy link
Member

giswqs commented Aug 27, 2020

@profLewis Thank you for reporting this bug. I just committed code to fix this bug. Please update geemap using geemap.update_package() or pip install git+https://github.com/giswqs/geemap and try your code again.

@giswqs
Copy link
Member

giswqs commented Aug 27, 2020

Here is what it looks like:

@giswqs giswqs closed this as completed Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants