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

Plot function is no longer working!! #24

Open
satyamroy001 opened this issue Apr 25, 2022 · 3 comments
Open

Plot function is no longer working!! #24

satyamroy001 opened this issue Apr 25, 2022 · 3 comments

Comments

@satyamroy001
Copy link

From example a code snippet taken-
orbit1 = KeplerianElements.with_period(90 * 60, body=earth) plot(orbit1,title='orbit1') plt.show()

Showing Error
**<array_function internals> in linspace(*args, **kwargs)

/usr/local/lib/python3.7/dist-packages/numpy/core/function_base.py in linspace(start, stop, num, endpoint, retstep, dtype, axis)
118
119 """
--> 120
121
122 div =(num - 1) if endpoint else num

TypeError: 'float' object cannot be interpreted as an integer**

@araminty
Copy link

The np.linspace function seems to have changed to require an int input not a float input. For a quick fix, you can cast the inputs on lines 136, 222, 262 of orbital/plotting.py to fix this problem.
e.g. on line 136 change:
f = np.linspace(f1, f2, num_points)
to
f = np.linspace(f1, f2, int(num_points))

@HaralDev
Copy link

@RazerM verified that this solution works, can you process that fix?

@OrbitalMechanic
Copy link

I recently ran into the same problem with linspace in several places in plotting.py. Attached is a copy of my updates for this issue.

plotting.py.txt

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

No branches or pull requests

4 participants