blockpy-edu / blockpy

Blockly that's more Python than JavaScript, powered with Skulpt
Apache License 2.0
398 stars 133 forks source link

import parking module error #41

Closed xwying closed 5 years ago

xwying commented 5 years ago

Hi, I was trying to develop a course assignment using BlockPy with the parking module. However, it seems that the feedback engine cannot process the code when I import the parking module.

Here is an easy way to reproduce the error:

  1. Open https://think.cs.vt.edu/blockpy/load?mode=instructor
  2. Simply put import parking in the __main__ tab and run. (Or drag any component from the Data - Parking module)

This will get me an tifa_error as follow:

Feedback: Algorithm Error 
tifa_error
Could not process code

The parking module itself seems working. Maybe it just cannot be properly parsed.

I also found that there is no problem importing other modules, for example, the following code can be correctly parsed.

import weather
reports = weather.get_report('New York')
print(reports)

Is this an internal bug or am I doing it wrong? Any suggestion will be appreciated. Thanks.

acbart commented 5 years ago

Hm, we stopped using the parking library a while back, so we never made type annotations for it (a feature of Tifa that allows you to specify types for the module).

For now, you can suppress the error by turning off TIFA for the given problems:

suppress("analyzer")
xwying commented 5 years ago

@acbart It worked! Thank you very much!