tylerni7 / missile-tid

Identifying missile launch signatures from traveling ionic disturbances using GPS data
BSD 3-Clause "New" or "Revised" License
130 stars 15 forks source link

Update connections import to Python 3.10 version #34

Closed iMurfyD closed 1 year ago

iMurfyD commented 1 year ago

In Python 3.10, they changed how collections is imported. This fixes it.

For more info: https://stackoverflow.com/questions/69596494/unable-to-import-freegames-python-package-attributeerror-module-collections

This seems backwards compatible with Python 3.6 and 3.7 on my machine (Intel Macbook Pro).

iMurfyD commented 1 year ago

Testing as specified by CONTRIBUTING.rst:

tox testing output:

(missile-tid) ➜  missile-tid git:(main) ✗ tox
ROOT: No tox.ini or setup.cfg or pyproject.toml found, assuming empty tox.ini at /Users/idesjard/Documents/Planetary Surface and Spacecraft Lab/Plasma Debris Wake Research/missile-tid
.pkg: install_requires> python -I -m pip install setuptools
.pkg: _optional_hooks> python /Users/idesjard/opt/anaconda3/envs/missile-tid/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: get_requires_for_build_sdist> python /Users/idesjard/opt/anaconda3/envs/missile-tid/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: build_sdist> python /Users/idesjard/opt/anaconda3/envs/missile-tid/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta
py: install_package_deps> python -I -m pip install atomicwrites awkward cartopy georinex h5py hatanaka 'laika@ git+https://github.com/commaai/laika#egg=laika' matplotlib numpy pyyaml ruptures scipy sympy xarray
py: install_package> python -I -m pip install --force-reinstall --no-deps '/Users/idesjard/Documents/Planetary Surface and Spacecraft Lab/Plasma Debris Wake Research/missile-tid/.tox/.tmp/package/1/tid-0.1.0.tar.gz'
.pkg: _exit> python /Users/idesjard/opt/anaconda3/envs/missile-tid/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta
  py: OK (62.35 seconds)
  congratulations :) (62.80 seconds)

I don't see a setup.py in the repo? setup.py test output:

(missile-tid) ➜  missile-tid git:(main) ✗ python setup.py test
python: can't open file '/Users/idesjard/Documents/Planetary Surface and Spacecraft Lab/Plasma Debris Wake Research/missile-tid/setup.py': [Errno 2] No such file or directory

flake8 test output: I've made modifications to get_data.py and created a new plotting file (ianplot.py) for my own purposes. Those fail flake8, but they're not a part of this pull request.

(missile-tid) ➜  missile-tid git:(main) ✗ flake8 tid tests
tests:0:1: E902 FileNotFoundError: [Errno 2] No such file or directory: 'tests'
tid/get_data.py:592:47: E711 comparison to None should be 'if cond is None:'
tid/ianplot.py:15:1: F401 'itertools.pairwise' imported but unused
tid/ianplot.py:16:1: F401 'astropy.units as u' imported but unused
tid/ianplot.py:19:1: F401 'matplotlib.ticker as mticker' imported but unused
tid/ianplot.py:19:36: W291 trailing whitespace
tid/ianplot.py:22:1: F401 'astropy.coordinates.GCRS' imported but unused
tid/ianplot.py:22:1: F401 'astropy.coordinates.ITRS' imported but unused
tid/ianplot.py:22:1: F401 'astropy.coordinates.CartesianDifferential' imported but unused
tid/ianplot.py:22:1: F401 'astropy.coordinates.CartesianRepresentation' imported but unused
tid/ianplot.py:68:1: E302 expected 2 blank lines, found 1
tid/ianplot.py:68:116: E501 line too long (127 > 115 characters)
tid/ianplot.py:74:42: E226 missing whitespace around arithmetic operator
tid/ianplot.py:76:42: E226 missing whitespace around arithmetic operator
tid/ianplot.py:83:33: E226 missing whitespace around arithmetic operator
tid/ianplot.py:95:53: E201 whitespace after '('
tid/ianplot.py:95:68: E226 missing whitespace around arithmetic operator
tid/ianplot.py:95:102: E226 missing whitespace around arithmetic operator
tid/ianplot.py:95:116: E501 line too long (121 > 115 characters)
tid/ianplot.py:95:120: E202 whitespace before ')'
tid/ianplot.py:98:1: W293 blank line contains whitespace
tid/ianplot.py:99:15: E702 multiple statements on one line (semicolon)
tid/ianplot.py:101:1: E302 expected 2 blank lines, found 1
tid/ianplot.py:107:16: E251 unexpected spaces around keyword / parameter equals
tid/ianplot.py:107:18: E251 unexpected spaces around keyword / parameter equals
tid/ianplot.py:129:40: E703 statement ends with a semicolon
tid/ianplot.py:130:71: W291 trailing whitespace
tid/ianplot.py:132:19: E128 continuation line under-indented for visual indent
tid/ianplot.py:160:37: E127 continuation line over-indented for visual indent
tid/ianplot.py:161:37: E127 continuation line over-indented for visual indent
tid/ianplot.py:166:1: W293 blank line contains whitespace
tid/ianplot.py:167:5: E303 too many blank lines (2)
tid/ianplot.py:168:5: F841 local variable 'lon_start' is assigned to but never used
tid/ianplot.py:169:5: F841 local variable 'lon_end' is assigned to but never used
tid/ianplot.py:170:5: F841 local variable 'lat_start' is assigned to but never used
tid/ianplot.py:171:5: F841 local variable 'lat_end' is assigned to but never used
tid/ianplot.py:173:116: E501 line too long (126 > 115 characters)
tid/ianplot.py:193:9: E303 too many blank lines (2)
tid/ianplot.py:198:22: E261 at least two spaces before inline comment
tid/ianplot.py:198:22: E262 inline comment should start with '# '
tid/ianplot.py:199:23: E261 at least two spaces before inline comment
tid/ianplot.py:199:23: E262 inline comment should start with '# '
tid/ianplot.py:213:5: E303 too many blank lines (2)
(missile-tid) ➜  missile-tid git:(main) ✗
tylerni7 commented 1 year ago

Thanks, looks good! for the tests: they should run on github automatically, but I think because I have a free account, I need to click the button to run them manually for new contributors.