Closed
Conversation
This typo is breaking timebars class. there is no `isUnset` method in timebars class. reverting change to `isNan` helper function.
Contributor
|
good catch, this is more correct in that it works, but if people do use the "don't use nan for unset" override system, these isNan checks would return bad results. So the We don't have a clean way to thread/chain the defaults system down through these eventkit operation types here yet. |
mattsta
pushed a commit
that referenced
this pull request
Dec 6, 2025
This typo is breaking timebars class. there is no `isUnset` method in timebars class. reverting change to `isNan` helper function. Fixes #197
Contributor
Author
|
maybe if we define something like this @dataclass
class IBDefaults:
"""A simple way to provide default values when populating API data."""
# optionally replace IBKR using -1 price and 0 size when quotes don't exist
emptyPrice: ClassVar[Final[Any]] = -1
emptySize: ClassVar[Final[Any]] = 0
# optionally replace ib_async default for all instance variable values before popualted from API updates
unset: ClassVar[Final[Any]] = nan
# optionally change the timezone used for log history events in objects (no impact on orders or data processing)
timezone: ClassVar[Final[tzinfo]] = timezone.utc
@classmethod
def isUnset(cls, value) -> bool:
# if default value is nan and value is nan, it is unset.
# else, if value matches default value, it is unset.
dev = cls.unset
return (dev != dev and value != value) or (value == dev)we can then use the IBDefaults instances, rather than instanciating it. this way there is no need to have an instance of IBDefaults and we hace have helper methods included. what do you think? for this "minor" release we can try it on Ticker. as we use IBDefaults in multiple places, we might not want to change everything now. |
lkaino
pushed a commit
to lkaino/ib_async
that referenced
this pull request
Feb 5, 2026
This typo is breaking timebars class. there is no `isUnset` method in timebars class. reverting change to `isNan` helper function. Fixes ib-api-reloaded#197
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This typo is breaking timebars class. there is no
isUnsetmethod in timebars class. reverting change toisNanhelper function.