Search found 168 matches

by v923z
Mon Apr 06, 2020 6:30 am
Forum: Development of MicroPython
Topic: MP_BINARY_OP_EQUAL in .binary_op with user type
Replies: 2
Views: 2239

Re: MP_BINARY_OP_EQUAL in .binary_op with user type

Hi, Have you read the implementation of mp_binary_op in runtime.c -- in this case the relevant detail is that it calls mp_obj_equal_not_equal. Not recently, so if it has changed recently, then I am not up to date. It goes through a bunch of the steps, to finally call the type's binary_op. Important...
by v923z
Sat Apr 04, 2020 8:32 pm
Forum: Development of MicroPython
Topic: MP_BINARY_OP_EQUAL in .binary_op with user type
Replies: 2
Views: 2239

MP_BINARY_OP_EQUAL in .binary_op with user type

Hi all, Before raising an issue on github, I wanted to ask, whether I try to do something note quite legal. I would like to clean up the implementation of the == , and != binary operators in ulab , and I don't get what I expect. Namely, the following code does what it is supposed to import ulab a = ...
by v923z
Wed Apr 01, 2020 8:12 pm
Forum: Development of MicroPython
Topic: MP_BINARY_OP_REVERSE for relational operators
Replies: 2
Views: 1999

Re: MP_BINARY_OP_REVERSE for relational operators

Jim,


Thanks for the comments! I wasn't aware of the difference between binary and comparison operators; at the moment, I handle everything in a single switch in binary_op, but obviously that is not the way to go. I will try to incorporate your suggestions.

Cheers,
Zoltán
by v923z
Wed Apr 01, 2020 8:26 am
Forum: Development of MicroPython
Topic: MP_BINARY_OP_REVERSE for relational operators
Replies: 2
Views: 1999

MP_BINARY_OP_REVERSE for relational operators

Hi all, in numpy , the following is valid a = array([1, 2, 3, 4]) a < 2 2 > a Both expressions mean the same, the difference is in, whether the array stands on the right or left hand side of the less than/more than operator. In micropython , operand ordering is handled via the MP_BINARY_OP_REVERSE_ ...
by v923z
Tue Mar 24, 2020 7:19 am
Forum: Development of MicroPython
Topic: linking with `round` for the pyboard
Replies: 5
Views: 4091

Re: linking with `round` for the pyboard

Jim, as requested, I have modified the makefiles, and issued a PR: https://github.com/micropython/micropython/pull/5789
by v923z
Mon Mar 23, 2020 9:42 am
Forum: Development of MicroPython
Topic: linking with `round` for the pyboard
Replies: 5
Views: 4091

Re: linking with `round` for the pyboard

jimmo wrote:
Fri Mar 20, 2020 8:50 am
But yes, if you did need to set a linker flag from your C module makefile, then if that's not currently possible then it would be worth sending a PR to make it possible. I will take a look later.
OK, I'll update the makefiles, and send a PR.
by v923z
Fri Mar 20, 2020 8:16 am
Forum: Development of MicroPython
Topic: linking with `round` for the pyboard
Replies: 5
Views: 4091

Re: linking with `round` for the pyboard

I have tried to add the linker flag in the Makefile, but that doesn't help at all. Can you explain what you mean by that... I added -lm to the linker flags. you should just need to add roundf.c to SRC_LIBM. (It seems to work for me). That solved it, thanks! However, I haven't yet found a way of app...
by v923z
Thu Mar 19, 2020 10:46 am
Forum: Development of MicroPython
Topic: linking with `round` for the pyboard
Replies: 5
Views: 4091

linking with `round` for the pyboard

Hi all, I have attempted to add the around function to ulab , and to that end, I call math's round as MICROPY_FLOAT_C_FUN(round) https://github.com/v923z/micropython-ulab/blob/master/code/vectorise.c#L156 . This works on the unix port, but I can't compile for the pyboard, and get a linker error LINK...
by v923z
Sun Feb 16, 2020 3:11 pm
Forum: Development of MicroPython
Topic: implementing properties in user modules
Replies: 17
Views: 8988

Re: implementing properties in user modules

Talking about https://github.com/stinos/micropython-wrap/blob/master/classwrapper.h#L372 bascially. With 'we' I meant 'me and colleagues' but actually I wrote all of it so on second thought: yes would be less confusing to just say 'I' :D Sorry, I wasn't nit-picking, I was simply curious. This wrapp...
by v923z
Sat Feb 15, 2020 7:24 pm
Forum: Development of MicroPython
Topic: implementing properties in user modules
Replies: 17
Views: 8988

Re: implementing properties in user modules

That overrides the locals dictionary, so nothing defined in the locals will be available as a class method. Yup, forgot we use a custom attr function which does all of that, i.e. first lookup locals dict then property getters etc Just curious: who is "we"? You did exactly what Jim's suggested earli...