Commit Graph

4 Commits

Author SHA1 Message Date
1f2bbff2d5 write more extensive documentation
- add documentation to previously documented classes and functions and refactor some of the documented one, in accordance to the PEP257 and ReStructuredText standards ;
- add some type hints ;
- use a NamedTuple for the `Galaxy.compute_users_score` method instead of a raw tuple. Also change a little bit the logic in the function which call the latter ;
- add some additional parameter checks on a few functions ;
- change a little bit the logic of the log level setting for the galaxy related commands.
2023-05-10 12:16:09 +02:00
6328b0c9e9 galaxy: use bulk_create whenever possible
This is a big performance gain, especially for the tests.

Examples:

----

`./manage.py test galaxy.tests.GalaxyTest.test_full_galaxy_state`

Measurements averaged over 3 run on *my machine*™:
Before: 2min15s
After: 1m41s

----

`./manage.py generate_galaxy_test_data --user-pack-count 1`

Before: 48s
After: 25s

----

`./manage.py rule_galaxy` (for 600 citizen, corresponding to 1 user-pack)

Before: 14m4s
After: 12m34s
2023-05-10 12:15:19 +02:00
bb365e4ee5 galaxy: better docstrings 2023-05-10 12:15:19 +02:00
1aa3bb8cc4 galaxy: add 'generate_galaxy_test_data' command for development at scale 2023-05-10 12:15:19 +02:00