Open cryptocoinserver opened 2 years ago
Thanks for the report. Please can you do pyjion.config(graph=True)
and send me the content of pyjion.graph(Position.is_close.__code__)
Tried it raises this:
Uncaught Exception: AttributeError: 'property' object has no attribute '__code__'
Using it initalized with self.position.is_close.__code__
:
Uncaught Exception: AttributeError: 'numpy.bool_' object has no attribute '__code__'
The code of Position.is_close
:
@property
def is_close(self) -> bool:
"""
Is the current position close?
:return: bool
"""
return self.qty == 0
I think the project I try to use it on is just too complex.
I think issue is happening because Pyjion had detected that self.qty
is a float when it was assigned in the constructor, then later it was replaced with a numpy float (which is a different type)
pyjion.config(level=0)
might fix it.
I'll have a think about a better solution for this.
This setting works. It's 20 seconds slower though then without pyjion. Probably compilation time? Thanks for your support!
level=0 effectively turns off the optimisations, so any opportunities to make the code faster will be disabled.
I'll look at a way of resolving this particular error so you can at least try level 1.
Code should be run at least 3 times in the same thread to see the effective performance difference
The strange thing is that config doesn't seem to have an effect. This is how I use pyjion:
Thank you for your help.