Code Monkey home page Code Monkey logo

datasette-haversine-point-path's People

Contributors

hcarter333 avatar

Watchers

 avatar

datasette-haversine-point-path's Issues

Exception becuase of missing math package

Getting the following from pytest:

Traceback (most recent call last):
  File "/home/hcarter333/datasette-haversine-point-path/datasette_haversine_point_path/__init__.py", line 36, in haversine_point_path_sql
    tx_x = cartesian_x(lat1,lon1)
  File "/home/hcarter333/datasette-haversine-point-path/datasette_haversine_point_path/__init__.py", line 7, in cartesian_x
    return (math.cos(f*deg2rad)*math.cos(l*deg2rad))
NameError: name 'math' is not defined

I'll add the path and I'll also add the dependeny to pyproject.toml.

Implement case where perpendicular distance isn't on short side of great circle

While the distance returned will always be the perpendicular distance from the location of the ionosonde to the great circle containing the path betwen the two QSO ham radio stations, it might be the distance from the ionosonde to the longer portion of the great circle (i.e. the portion of the great circle that the radio waves did not propogate along. For example, the Alaska ionosonde (Gakona) shown below

image

taken from the maximum usable frequency (MUF) map will not have a perpendicular path to the QSO path used in the original example from San Fancisco to the Netherlands shown below
image

Instead, the shorter distance to the path will be to the endpoint in San Francisco.

Modify the code to test which path is shorter, and return the shortest path distance.

Inputs need type conversion

In case the database hands in floats coded as strings, they need to be cast back to floats. This same issue occurred in datasette-haversine which is where the test case for this package originated. Here's the error message

Traceback (most recent call last):
  File "/home/hcarter333/datasette-haversine-point-path/datasette_haversine_point_path/__init__.py", line 39, in haversine_point_path_sql
    tx_x = cartesian_x(lat1,lon1)
  File "/home/hcarter333/datasette-haversine-point-path/datasette_haversine_point_path/__init__.py", line 10, in cartesian_x
    return (math.cos(f*deg2rad)*math.cos(l*deg2rad))
TypeError: can't multiply sequence by non-int of type 'float'

the fix will be to convert the inputs into floats.

haversine_point_path not found

pytest is returning

image

I believe this is because the pyproject.toml file doesn't exist yet, and I haven't run
pip install -e '.[test]'

Distance approximations of expected value are outside default approx envelope for pytest

The comparisions did not pass to one part in a million:

FAILED tests/test_haversine_point_path.py::test_haversine[float-ft-5805047] - assert 5805047 == 5796584.922005589 ± 5.8e+00
FAILED tests/test_haversine_point_path.py::test_haversine[float-m-1769378.36] - assert 1769378.36 == 1766799.08422737 ± 1.8e+00
FAILED tests/test_haversine_point_path.py::test_haversine[float-in-69660567] - assert 69660567 == 69559019.06407061 ± 7.0e+01

This is due entirely to the fact that I measured the distance by hand using google maps. I'm goin to turn the rel value down to 1e-3.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.