Search found 301 matches

by stijn
Mon Jan 28, 2019 9:13 am
Forum: Programs, Libraries and Tools
Topic: namedtuple difference with CPython
Replies: 5
Views: 169

Re: namedtuple difference with CPython

But are there cases where we don't want this to happen? I think this is the key question. Don't have an answer for it, couldn't immediately find any other types without locals_dict either. But anyway if this is more general than just namedtuple (i.e. there's other types which have the same incompat...
by stijn
Sat Jan 26, 2019 9:09 am
Forum: General Discussion and Questions
Topic: Definitions for internal functions
Replies: 2
Views: 104

Re: Definitions for internal functions

Search for places in *.c files where 'readinto' gets registered in a locals_dict , and look for the matching file for the port you are interested in (it's possible not all ports use the exact same implementation so this matters). You'll find matches like micropython/ports/esp32/machine_uart.c: 334: ...
by stijn
Sat Jan 26, 2019 9:00 am
Forum: Development of MicroPython
Topic: tranformation MP_QSTR__slash_lib into /lib
Replies: 1
Views: 83

Re: tranformation MP_QSTR__slash_lib into /lib

makeqstrdata.py processes the compiler-generated files and has

Code: Select all

codepoint2name[ord('/')] = 'slash'
by stijn
Thu Jan 24, 2019 9:04 am
Forum: Programs, Libraries and Tools
Topic: namedtuple difference with CPython
Replies: 5
Views: 169

Re: namedtuple difference with CPython

I think modifying namedtuple_attr has no effect because that's not what is being called for Event.EMPTY = ...., you're assigning to the type there, not to an actual tuple instance. Best to run this in a build which has MICROPY_DEBUG_VERBOSE defined and/or under a debugger, to see what really goes on.
by stijn
Tue Jan 22, 2019 12:13 pm
Forum: ESP32 boards
Topic: How to install modules in a Jupyter Micropython kernel?
Replies: 10
Views: 414

Re: How to install modules in a Jupyter Micropython kernel?

In this case I'd just clone from https://github.com/adafruit/micropython-adafruit-tsl2561, say to ~/.micropython/lib/micropython-adafruit-tsl2561, delete setup.py from that directory (just so you don't accidentally import setup), sys.path.append('~/.micropython/lib/micropython-adafruit-tsl2561'), im...
by stijn
Mon Jan 21, 2019 8:47 am
Forum: ESP32 boards
Topic: How to install modules in a Jupyter Micropython kernel?
Replies: 10
Views: 414

Re: How to install modules in a Jupyter Micropython kernel?

You should report the upuip problem on github (https://github.com/micropython/micropython) because it looks like a bug, it shouldn't report vague errors like 'index out of range'. It should report 'package not found' or so instead. It's also weird that it wants to install to /lib/ instead of ~/.micr...
by stijn
Sun Jan 20, 2019 9:11 am
Forum: ESP32 boards
Topic: How to install modules in a Jupyter Micropython kernel?
Replies: 10
Views: 414

Re: How to install modules in a Jupyter Micropython kernel?

Sorry but without more information it's pretty hard to help; you should paste error messages here instead of describing your interpretation of them. Likewise for the code you are using. Anyway, couple of problems here: - the package which pip from conda installs is this one https://pypi.org/project/...
by stijn
Sat Jan 19, 2019 8:18 am
Forum: ESP32 boards
Topic: How to install modules in a Jupyter Micropython kernel?
Replies: 10
Views: 414

Re: How to install modules without a Jupyter Micropython kernel?

There are multiple Jupyter kernel implementations for MicroPython so you should specify which one you use. Also please clarify what 'tried to use upip but it is not working' means. What error occurs etc? But in any case all kernels work with the same principle so to get something to import, the dire...
by stijn
Fri Jan 18, 2019 8:58 am
Forum: The MicroPython pyboard
Topic: ADC simultaneous sampling?
Replies: 9
Views: 298

Re: ADC simultaneous sampling?

As a general principle if you don't have simultaneous sampling you figure out the delay between the channels (usually nChannels/fs for consecutive channels) and shift your waveforms accordingly in post-processing.
by stijn
Wed Jan 16, 2019 9:04 am
Forum: General Discussion and Questions
Topic: Micropython Syntax Analysis
Replies: 3
Views: 164

Re: Micropython Syntax Analysis

The problem is the OP is asking about syntax errors, which happen in the parser already so cannot be caught like that. Unless the entire file execution is wrapped which I think can be done by enabling MICROPY_PY_BUILTINS_EXECFILE to get the execfile function. E.g. principle would be in C: pyexec_fil...