Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(get_at_distance returns the first index): get_at_distance returns the first index no matter the input distance #72

Merged

Conversation

gambon2010
Copy link
Contributor

@gambon2010 gambon2010 commented Jun 15, 2024

The way the assignment and comparison are combined leads to an incorrect evaluation.

The line is trying to both assign and compare in a single statement, which results in incorrect logic. The assignment should be done separately from the comparison.

@o-murphy
Copy link
Owner

o-murphy commented Jun 17, 2024

@gambon2010
Thanks, dude
It also will work in oneline if add the brackets like

        if (i := self.index_at_distance(d)) < 0:
            raise ArithmeticError(
                f"Calculated trajectory doesn't reach requested distance {d}"
            )

@o-murphy o-murphy changed the base branch from master to 2.0.2 June 17, 2024 10:31
@o-murphy o-murphy merged commit ce3ecf1 into o-murphy:2.0.2 Jun 17, 2024
16 checks passed
o-murphy added a commit that referenced this pull request Jun 17, 2024
* fix(get_at_distance returns the first index): get_at_distance returns the first index no matter the input distance (#72)

* #71 fix(get_at_distance returns the first index): fixed bug, now returns correct index

* Update trajectory_data.py

---------

Co-authored-by: Chris <christophe@fritschy.net>
Co-authored-by: Dmytro Yaroshenko <73843436+o-murphy@users.noreply.github.com>

* bumped version to 2.1.0b1

---------

Co-authored-by: gambon2010 <112812216+gambon2010@users.noreply.github.com>
Co-authored-by: Chris <christophe@fritschy.net>
@o-murphy o-murphy linked an issue Jun 17, 2024 that may be closed by this pull request
@o-murphy o-murphy mentioned this pull request Jul 20, 2024
o-murphy added a commit that referenced this pull request Jul 20, 2024
* fix(get_at_distance returns the first index): get_at_distance returns the first index no matter the input distance (#72)

* #71 fix(get_at_distance returns the first index): fixed bug, now returns correct index

* Update trajectory_data.py

---------




* bumped version to 2.1.0b1

---------

Co-authored-by: gambon2010 <112812216+gambon2010@users.noreply.github.com>
Co-authored-by: Chris <christophe@fritschy.net>
o-murphy added a commit that referenced this pull request Jul 20, 2024
* fix(get_at_distance returns the first index): get_at_distance returns the first index no matter the input distance (#72)

* #71 fix(get_at_distance returns the first index): fixed bug, now returns correct index

* Update trajectory_data.py

---------

Co-authored-by: Chris <christophe@fritschy.net>
Co-authored-by: Dmytro Yaroshenko <73843436+o-murphy@users.noreply.github.com>

* bumped version to 2.1.0b1

* 2.1.0b1 (#73) (#76)

* fix(get_at_distance returns the first index): get_at_distance returns the first index no matter the input distance (#72)

* #71 fix(get_at_distance returns the first index): fixed bug, now returns correct index

* Update trajectory_data.py

---------

* bumped version to 2.0.2

---------

Co-authored-by: gambon2010 <112812216+gambon2010@users.noreply.github.com>
Co-authored-by: Chris <christophe@fritschy.net>

* removed cli entry and experimental .toml-based profiles support

---------

Co-authored-by: gambon2010 <112812216+gambon2010@users.noreply.github.com>
Co-authored-by: Chris <christophe@fritschy.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get_at_distance returns the first index no matter the input distance
2 participants