1
0
Fork 0
Commit Graph

1364 Commits (5948cc644263e7ef5e1ddc51958d039dca3e7be7)

Author SHA1 Message Date
Corey Shields 5948cc6442 Stop crawlers from traversing observations
The hits are a little much, and unnecessary.
 
Signed-off-by: Corey Shields <cshields@gmail.com>
2019-12-21 11:37:41 -05:00
Alfredos-Panagiotis Damkalis b43dd4cf4d Fix regression of end filter in observations page
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2019-12-20 17:27:43 +02:00
Vasilis Tsiligiannis c0bf3ac42d docker-compose: Preserve databases data in volumes
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-12-20 02:54:58 +02:00
Vasilis Tsiligiannis f76a4e19c6 docker-compose: Replace deprecated links with service dependencies
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-12-20 01:57:54 +02:00
Vasilis Tsiligiannis 3803d0e45b docker-compose: Bump 'redis' version
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-12-20 01:53:18 +02:00
Vasilis Tsiligiannis fb0b5d1f06 docker-compose: Bump 'mariadb' version
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-12-20 01:53:18 +02:00
Vasilis Tsiligiannis 1af58b9aa2 Refresh requirements
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-12-20 01:53:18 +02:00
Fabian P. Schmidt fab37d905b views/prediction_windows: Add comments
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-19 13:40:01 +01:00
Fabian P. Schmidt 4539cc4af0 views: Remove single-use variables 'scheduled_obs_queryset'
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-19 13:40:01 +01:00
Fabian P. Schmidt 06b0d58146 Update 'satellitetle' dependency
v0.8.0 -> v0.8.1

Fixes broken TLE update due to trailing newline in AMSAT TLE source.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-19 09:57:46 +01:00
Vasilis Tsiligiannis a656af907b gitlab-ci: Bump 'node' Docker image version
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-12-17 11:33:32 +02:00
Fabian P. Schmidt 155aae4a99 pylint: Add message names in comments
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-17 09:23:49 +00:00
Fabian P. Schmidt 7433d1f757 pylint: Enable python3 porting checker
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-17 09:23:49 +00:00
Fabian P. Schmidt 6bedc4dfa3 api/serializers: Remove single-use variable (2) (R0914)
Single-use variables clutter the local namespace and decrease reability.
This patch is part of a series to fix the too-many-locals (R0914)
pylint error for the NewObservationListSerializer.validate method.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-16 01:15:44 +01:00
Fabian P. Schmidt 54fa6c16c7 api/serializers: Use defaultdict
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-16 01:15:44 +01:00
Fabian P. Schmidt 97d065d4c4 api/serializers: Use sets instead of lists directly
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-16 01:15:44 +01:00
Fabian P. Schmidt 5a0c2c62af api/serializers: Remove single-use variables (R0914)
Single-use variables clutter the local namespace and decrease reability.
This patch is part of a series to fix the too-many-locals (R0914)
pylint error for the NewObservationListSerializer.validate method.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-16 00:25:38 +01:00
Fabian P. Schmidt 77b15b042e views/ObservationListView: Calculate filtered value once (R0912)
This commit reduces the number of branches in `get_queryset` in
order to fix a too-many-branches (R0912) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-15 18:12:36 +00:00
Fabian P. Schmidt e6ba1aaec5 views/ObservationListView: Introduce parameter filter mapping (R0912)
This commit reduces the number of branches in `get_queryset` in
order to fix a too-many-branches (R0912) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-15 18:12:36 +00:00
Fabian P. Schmidt cfc3f3accb views/prediction_windows: Refactor parameter parsing into a seperate function (R0912)
Fixes a too-many-branches (R0912) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-15 18:12:36 +00:00
Fabian P. Schmidt 8df2c36075 views/prediction_windows: Initialize variables as late as possible
This should improves the readability of the code.
2019-12-15 18:12:36 +00:00
Fabian P. Schmidt 92b0c2c37f views/prediction_windows: Move parameter parsing to the beginning 2019-12-15 18:12:36 +00:00
Fabian P. Schmidt e034ef9b21 tests/ObservationFactory: Force start and end datetime to be exactly at the second mark
Fixes issue #696.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-13 17:39:53 +01:00
Fabian P. Schmidt aa3261683d celery|tasks: Fix celery cyclical dependency (R0401)
Fixes the cyclical dependency between celery.py and tasks.py when
the task is called outside of celery by switching to autodiscovered tasks.
Use @shared_task decorator and wrapper tasks to workaround celery bug.

Fixes cyclic-import pylint error (R0401).

Commit based on: librespacefoundation/satnogs/satnogs-db@61f9137a

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-07 15:22:41 +01:00
Fabian P. Schmidt 406f270efc tests/ObservationFactory: Choose from existing satellites & tles
The ObservationFactory called a subfactory "SatelliteFactory" to
generate satellites with random norad ids (in the 2000 - 4000 range).
This range of NORAD IDs can be found in public catalogs, but most of
those satellites are already decayed (and thus they are not part of
any Celestrak list).

Running update_all_tle thus creates many requests to Celestrak
(~<= 200, the number of observation fixtures) by trying to fetch their
TLEs via the satcat/tle.php endpoint.

This commit solves that problem by adding a RealisticObservationFactory
which uses only existing Satellites (fetched from satnogs-db).

A small caveat: Assigned Satellite & TLE for a generated observation
most likely wont match (but this was already the case before).

Another small caveat: The RealisticObservationFactory can generate at
max only observations as there are satellite (a limitation of the
underlying factory.Iterator).

Requires the TLEs to be fetched before the fixtures can be generated.

Fixes #695.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-06 18:11:29 +01:00
Fabian P. Schmidt 9c50deb38e tasks/update_all_tle: Only try to fetch offical TLEs from catalogs
Similar commit in db: librespacefoundation/satnogs/satnogs-db@34f2641b

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-05 22:59:51 +00:00
Fabian P. Schmidt 114223f7c2 tasks/update_all_tle: Use set instead of list
Simplifies the logic.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-05 22:59:51 +00:00
Fabian P. Schmidt efd645de6e management/initialize: Show fixture generation statistics
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-04 20:16:48 +01:00
Fabian P. Schmidt 744106b495 management/fetch_data: Show import statistics
Instead of printing several hundred lines on initialization,
show some useful statistics instead.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-04 20:07:48 +01:00
Alfredos-Panagiotis Damkalis 4656347fff Handle pyephem next_pass() ValueError
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2019-12-02 20:07:03 +02:00
Fabian P. Schmidt ad388e80b3 views: Ignore false-positive no-member pylint error (E1101)
Pylint throws a false positive for E1101 under Python2
(but runs cleanly in Python3, TODO: To be checked!).

Similar commit in db: librespacefoundation/satnogs/satnogs-db@9359532d

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-02 17:57:52 +00:00
Fabian P. Schmidt 5bfbc65128 Remove fetch_tle management command
This command has been superseeded by `update_all_tle`. While the
latter doesn't allow to update the TLE of only a single satellite,
it comes with the improvement of not only fetching from Celestrak
like `fetch_tle` but also from different other sources.

Additionally, this command is broken since almost a year (#568).

Fixes #568.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-02 17:44:25 +00:00
Fabian P. Schmidt 76c393979a models|tests: Ignore too-few-public-methods (R0903)
Ignoring too-few-public-methods (R0903) pylint error  for tests.py
where we do not need to care about public methods,
and for django managers in models.py.

Similar commit in db: librespacefoundation/satnogs/satnogs-db@91d8ba20

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-02 16:49:03 +01:00
Fabian P. Schmidt 13da259255 Ignore ungrouped-imports pylint error where it clashes with isort (C0412)
There are clashes between the positioning and ordering of our imports
between pylint and isort, just ignoring them on the pylint side for now.

Based on: librespacefoundation/satnogs/satnogs-db@fc8f9a8c

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-02 10:34:00 +00:00
Fabian P. Schmidt 602b4fee84 settings: Import only the init symbol from sentry_sdk (C0412)
Fixing the clash between ungrouped-imports (C0412) pylint error and
isort is the desired side effect of this commit.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-02 10:34:00 +00:00
Fabian P. Schmidt 16d36b7bc6 management/commands: Update to use argparse-based interface
With Django 1.8 the interface for argument parsing of custom
django-admin commands was updated to use argparse, deprecating
the 'args and 'option_list' interface, see [1] and [2].

[1]: https://docs.djangoproject.com/en/1.8/howto/custom-management-commands/#django.core.management.BaseCommand.args
[2]: https://docs.djangoproject.com/en/1.8/howto/custom-management-commands/#django.core.management.BaseCommand.option_list

Fixes #568.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-02 10:24:24 +00:00
Fabian P. Schmidt a0c879d7b8 scheduling/predict_available_observation_windows: Fix docstring
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-02 10:12:32 +00:00
Fabian P. Schmidt 3731be7adf views: Ignore too-many-ancestors error for rest_framework classes (R0901)
Ignoring cases of too many ancestors in API views.py as these
are upstream, not much we can do about it.

Similar commit in db: librespacefoundation/satnogs/satnogs-db@82713517

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-01 19:51:37 +01:00
Fabian P. Schmidt a7acd6f0d0 Update 'satellitetle' dependency
Move 'satellitetle' from 0.7.0 to 0.8.0,
fixes fetch_tle management command (broken due to an API change
by Celestrak).

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-01 18:25:45 +01:00
Fabian P. Schmidt 0fb5eef514 Ignore no-self-use error for serialization and ModelAdmin member functions (R0201)
Fixes no-self-use (R0201) pylint error.
Similar commit in db: librespacefoundation/satnogs/satnogs-db@9989efb4

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-11-30 20:20:36 +01:00
Fabian P. Schmidt 5c784c1f0e views/ObservationListView: Use for-loop for vetting based filtering
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-11-30 19:34:49 +01:00
Fabian P. Schmidt 48c27fbe8d views/ObservationListView: Add get_filter_params method (R0915)
This commit refactors the HTTP GET parameter parsing into a new
funciton get_filter_params, reducing the complexity of get_queryset
and thus fixes a too-many-statements (R0915) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-11-30 19:34:49 +01:00
Fabian P. Schmidt f91e9adbb9 views/observation_new_post: Improve code style (R0915)
This commit should improve the code readability by removing variables
which were only used once.

Fixes a too-many-statements (R0915) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-11-30 19:34:49 +01:00
Fabian P. Schmidt 87e858e7b5 model: Add missing __str__ methods (W5101)
Fixes pylint-django error W5101 (model-missing-unicode).

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-11-30 19:17:23 +01:00
Fabian P. Schmidt 0ebc39c2fd tests: Replace deprecated assertEquals with assertEqual (W1505)
Fixes deprecated-method (W1505) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-11-30 18:40:26 +01:00
Fabian P. Schmidt afb5783324 templatetags/paginator: Register the tag using a decorator
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-11-30 17:39:36 +01:00
Fabian P. Schmidt b5fc365469 templatetags/paginator: Fix typo
Fixes regression introduces by 211a7c5.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-11-30 17:07:07 +01:00
Fabian P. Schmidt dfed5c65e6 base/models: zip-builtin related 2to3 changes
Fixes pylint error zip-builtin-not-iterating (W1637).
Similar commit in db: librespacefoundation/satnogs/satnogs-db@8734748e

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-11-30 16:43:37 +01:00
Fabian P. Schmidt 01cabde483 pylint: Re-Enable redefined-builtin (W0622)
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-11-30 16:39:05 +01:00
Fabian P. Schmidt a06fdec256 pylint: Re-Enable redefined-outer-name (W0621)
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-11-30 16:39:05 +01:00