Skip to content

Conversation

@JeS24
Copy link
Member

@JeS24 JeS24 commented Jun 11, 2020

Fixes #113, #141, #410, #507, #508, #514 , #515.
Notes on fixes:

  1. Scaling error in utils.kerrnewman_utils.py #508 - Requires discussion
  2. Mathematical error in utils.schwarzschild_utils.py #507 -time_velocity methods, across <Metric>_utils modules, have been moved to and repackaged into 1 function in coordinates.utils, renamed as v_t(). This function uses the supplied metric and 3-Velocity, and the expression for spacetime interval: $g_{ab} u^a u ^b = 0 or 1$ (null-like or time-like), to determine the timelike component of 4-Velocity, and hence it bypasses the method used in previous Schwarzschild, Kerr and KerrNewman classes.

Touched modules:

  • einsteinpy.metric
  • einsteinpy.utils
  • einsteinpy.coordinates.utils
  • geodesic
  • examples
  • plotting.geodesic
  • test_metric
  • test_utils
  • test_coordinates/test_utils
  • test_geodesic
  • test_examples
  • test_plotting/test_geodesic
Other files
  • index.ipynb
  • docs/source/jupyter.rst
  • docs/source/user_guide
  • docs/source/api/
  • docs/source/examples/
  • .codeclimate.yml
  • CHANGELOG

Current changes:

  1. New Metric class added and old metric API removed.
  2. Moved calculate_trajectory() from metric to geodesic and time_velocity() (now v_t()) to coordinates.utils.
  3. Merged most utility functions from utils into metric (only file untouched is scalar_factor.py)
  4. Modified geodesic, examples and example Jupyter Notebooks to work with new API.
  5. Added some new utilities to coordinates.utils.
  6. Added tests for new API (metric, utils, geodesic, examples, plotting)
  7. Moved calculate_trajectory() tests from test_metric to test_geodesic.

Pending changes:

@pep8speaks
Copy link

pep8speaks commented Jun 11, 2020

Hello @JeS24! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 242:9: W503 line break before binary operator
Line 243:9: W503 line break before binary operator
Line 244:9: W503 line break before binary operator

Line 297:17: W503 line break before binary operator
Line 303:17: W503 line break before binary operator
Line 320:17: W503 line break before binary operator
Line 324:17: W503 line break before binary operator

Line 131:13: W503 line break before binary operator
Line 133:17: W503 line break before binary operator
Line 134:17: W503 line break before binary operator
Line 136:13: W503 line break before binary operator
Line 203:17: W503 line break before binary operator
Line 204:17: W503 line break before binary operator
Line 218:17: W503 line break before binary operator
Line 219:17: W503 line break before binary operator

Line 140:13: W503 line break before binary operator
Line 141:13: W503 line break before binary operator
Line 211:25: W503 line break before binary operator
Line 212:25: W503 line break before binary operator
Line 214:21: W503 line break before binary operator
Line 216:17: W503 line break before binary operator
Line 218:21: W503 line break before binary operator
Line 231:17: W503 line break before binary operator
Line 239:25: W503 line break before binary operator
Line 241:21: W503 line break before binary operator
Line 243:17: W503 line break before binary operator
Line 245:21: W503 line break before binary operator
Line 246:21: W503 line break before binary operator
Line 592:13: W503 line break before binary operator
Line 593:13: W503 line break before binary operator

Line 125:13: W503 line break before binary operator
Line 126:13: W503 line break before binary operator
Line 127:13: W503 line break before binary operator

Line 131:35: W504 line break after binary operator
Line 132:35: W504 line break after binary operator
Line 133:35: W504 line break after binary operator
Line 368:35: W504 line break after binary operator
Line 369:35: W504 line break after binary operator
Line 370:35: W504 line break after binary operator
Line 371:35: W504 line break after binary operator

Line 163:81: W504 line break after binary operator

Comment last updated at 2020-06-24 19:24:05 UTC

@shreyasbapat
Copy link
Member

All tests are failing. Do you expect them to fail?

@JeS24
Copy link
Member Author

JeS24 commented Jun 11, 2020

@shreyasbapat Not at all. The old files have not been modified, except for addition of deprecation warnings. According to the traceback, these are the tests, that have failed:

  • Py38
  1. test_geodesics/test_static.py::test_plot_in_3d
  2. test_geodesics/test_interactive.py::test_plot_calls_draw_attractor_Manualscale
  • Py37

    • Timed out:
    tests/test_symbolic/test_tensor.py::test_ValueError2  
    
    Too long with no output (exceeded 10m0s): context deadline exceeded
    
  • Py36

  1. test_plotting/test_geodesics/test_static.py::test_plot_in_3d
  2. test_plotting/test_geodesics/test_interactive.py::test_plot_draws_fig
  3. test_metric/test_kerrnewman.py::test_calculate_trajectory1
  4. test_plotting/test_geodesics/test_static.py::test_plot_calls_draw_attractor_Manualscale
  5. test_plotting/test_geodesics/test_static.py::test_staticgeodesicplotter_has_axes
  6. test_plotting/test_geodesics/test_interactive.py::test_plot_calls_draw_attractor_Manualscale

None of the related files were modified in this PR, which makes this even weirder.

@shreyasbapat
Copy link
Member

Can you force push once?

@JeS24
Copy link
Member Author

JeS24 commented Jun 11, 2020

@shreyasbapat It's telling me, "Everything up-to-date". So, I made a non-consequential change and pushed it.

@shreyasbapat
Copy link
Member

You usually do

git commit --amend --no-edit
git push -f origin branch

@JeS24
Copy link
Member Author

JeS24 commented Jun 11, 2020

Okay, will keep this in reference. Do you want me to force push or let the tests run for now?

@shreyasbapat
Copy link
Member

Okay, will keep this in reference. Do you want me to force push or let the tests run for now?

Oh, let them run now. Then I'll review

@JeS24 JeS24 force-pushed the refac_metric_utils branch from 0428e85 to 11fdaf6 Compare June 12, 2020 08:29
@shreyasbapat
Copy link
Member

Have you made the changes discussed in the chats?

@JeS24
Copy link
Member Author

JeS24 commented Jun 14, 2020

The current failures are expected. I am modifying geodesics and examples, which should fix half of them.

@shreyasbapat
Copy link
Member

Should I review?

@JeS24
Copy link
Member Author

JeS24 commented Jun 15, 2020

Tests for geodesic, examples and plotting.geodesic, plotting.examples are currently commented out. This is to check for any other test failure. Those tests will be back in the next few commits.

@shreyasbapat
Copy link
Member

Any progress?

@shreyasbapat
Copy link
Member

@JeS24 Do you have any fix for these codefactor issues?

@shreyasbapat
Copy link
Member

Okay, whatever. Merging now.

@shreyasbapat shreyasbapat merged commit 78bf5d9 into einsteinpy:master Jun 24, 2020
@JeS24
Copy link
Member Author

JeS24 commented Jun 24, 2020

@JeS24 Do you have any fix for these codefactor issues?

I'm not sure about the cyclic imports issue, but the "unnecessary elif" ones are simple to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

5 participants