orb.apps.auto_rebalance.autobalance module¶
- class orb.apps.auto_rebalance.autobalance.ABView(**kwargs)¶
Bases:
Popup- add_from_to_rule()¶
- add_ignore_rule()¶
- delete_rule(index)¶
- obj¶
DictProperty(defaultvalue=0, rebind=False, **kw) Property that represents a dict.
- Parameters:
- defaultvalue: dict, defaults to {}
Specifies the default value of the property.
- rebind: bool, defaults to False
See
ObjectPropertyfor details.
Changed in version 1.9.0: rebind has been introduced.
Warning
Similar to
ListProperty, when assigning a dict to aDictProperty, the dict stored in the property is a shallow copy of the dict and not the original dict. SeeListPropertyfor details.
- open(*args, **kwargs)¶
This gets called when the popup is first opened.
- populate_rules()¶
- save(*_)¶
- start()¶
- stop()¶
- update_obj(attr, value)¶
- class orb.apps.auto_rebalance.autobalance.AutoBalance(*args, **kwargs)¶
Bases:
Plugin- cleanup()¶
Performs any required cleanup before reloading
- main()¶
- class orb.apps.auto_rebalance.autobalance.BaseView(**kwargs)¶
Bases:
BoxLayout- index¶
NumericProperty(defaultvalue=0, **kw) Property that represents a numeric value.
It only accepts the int or float numeric data type or a string that can be converted to a number as shown below. For other numeric types use ObjectProperty or use errorhandler to convert it to an int/float.
It does not support numpy numbers so they must be manually converted to int/float. E.g.
widget.num = np.arange(4)[0]will raise an exception. Numpy arrays are not supported at all, even by ObjectProperty because their comparision does not return a bool. But if you must use a Kivy property, use a ObjectProperty withcomparatorset tonp.array_equal. E.g.:>>> class A(EventDispatcher): ... data = ObjectProperty(comparator=np.array_equal) >>> a = A() >>> a.bind(data=print) >>> a.data = np.arange(2) <__main__.A object at 0x000001C839B50208> [0 1] >>> a.data = np.arange(3) <__main__.A object at 0x000001C839B50208> [0 1 2]
- Parameters:
- defaultvalue: int or float, defaults to 0
Specifies the default value of the property.
>>> wid = Widget() >>> wid.x = 42 >>> print(wid.x) 42 >>> wid.x = "plop" Traceback (most recent call last): File "<stdin>", line 1, in <module> File "properties.pyx", line 93, in kivy.properties.Property.__set__ File "properties.pyx", line 111, in kivy.properties.Property.set File "properties.pyx", line 159, in kivy.properties.NumericProperty.check ValueError: NumericProperty accept only int/float
Changed in version 1.4.1: NumericProperty can now accept custom text and tuple value to indicate a type, like “in”, “pt”, “px”, “cm”, “mm”, in the format: ‘10pt’ or (10, ‘pt’).
- parent_view¶
ObjectProperty(defaultvalue=None, rebind=False, **kw) Property that represents a Python object.
- Parameters:
- defaultvalue: object type
Specifies the default value of the property.
- rebind: bool, defaults to False
Whether kv rules using this object as an intermediate attribute in a kv rule, will update the bound property when this object changes.
That is the standard behavior is that if there’s a kv rule
text: self.a.b.c.d, wherea,b, andcare properties withrebindFalseanddis aStringProperty. Then when the rule is applied,textbecomes bound only tod. Ifa,b, orcchange,textstill remains bound tod. Furthermore, if any of them wereNonewhen the rule was initially evaluated, e.g.bwasNone; thentextis bound toband will not become bound todeven whenbis changed to not beNone.By setting
rebindtoTrue, however, the rule will be re-evaluated and all the properties rebound when that intermediate property changes. E.g. in the example above, wheneverbchanges or becomes notNoneif it wasNonebefore,textis evaluated again and becomes rebound tod. The overall result is thattextis now bound to all the properties amonga,b, orcthat haverebindset toTrue.- **kwargs: a list of keyword arguments
- baseclass
If kwargs includes a baseclass argument, this value will be used for validation: isinstance(value, kwargs[‘baseclass’]).
Warning
To mark the property as changed, you must reassign a new python object.
Changed in version 1.9.0: rebind has been introduced.
Changed in version 1.7.0: baseclass parameter added.
- rule¶
ObjectProperty(defaultvalue=None, rebind=False, **kw) Property that represents a Python object.
- Parameters:
- defaultvalue: object type
Specifies the default value of the property.
- rebind: bool, defaults to False
Whether kv rules using this object as an intermediate attribute in a kv rule, will update the bound property when this object changes.
That is the standard behavior is that if there’s a kv rule
text: self.a.b.c.d, wherea,b, andcare properties withrebindFalseanddis aStringProperty. Then when the rule is applied,textbecomes bound only tod. Ifa,b, orcchange,textstill remains bound tod. Furthermore, if any of them wereNonewhen the rule was initially evaluated, e.g.bwasNone; thentextis bound toband will not become bound todeven whenbis changed to not beNone.By setting
rebindtoTrue, however, the rule will be re-evaluated and all the properties rebound when that intermediate property changes. E.g. in the example above, wheneverbchanges or becomes notNoneif it wasNonebefore,textis evaluated again and becomes rebound tod. The overall result is thattextis now bound to all the properties amonga,b, orcthat haverebindset toTrue.- **kwargs: a list of keyword arguments
- baseclass
If kwargs includes a baseclass argument, this value will be used for validation: isinstance(value, kwargs[‘baseclass’]).
Warning
To mark the property as changed, you must reassign a new python object.
Changed in version 1.9.0: rebind has been introduced.
Changed in version 1.7.0: baseclass parameter added.
- update_rule(attr, value)¶
- class orb.apps.auto_rebalance.autobalance.FromTo(alias, fee_rate, num_sats=100000, priority=0, time_pref=0.5, from_all=[], from_any=[], to_all=[], to_any=[])¶
Bases:
object- eval()¶
- class orb.apps.auto_rebalance.autobalance.Rebalance(visible=True, *args, **kwargs)¶
Bases:
StoppableThread- do_rebalancing(*args)¶
This is the ‘heart’ of the rebalancer.
- run(*_)¶
Method representing the thread’s activity.
You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.
- schedule()¶
- stop()¶
- class orb.apps.auto_rebalance.autobalance.RuleBase(fee_rate, priority, num_sats)¶
Bases:
object
- class orb.apps.auto_rebalance.autobalance.Setter(_from, _to, fee_rate, time_pref, num_sats, pk_ignore, priority=0)¶
Bases:
RuleBase- eval_fee_rate()¶
- set()¶
- orb.apps.auto_rebalance.autobalance.get_dumper()¶
- orb.apps.auto_rebalance.autobalance.get_loader()¶