pathfinder-for-autonomous-navigation / psim

Six DOF flight simulator and related GNC implementations.
MIT License
4 stars 6 forks source link

Initial Python PSim Configuration Parser #157

Closed kylekrol closed 4 years ago

kylekrol commented 4 years ago

Initial Python PSim Configuration Parser

Fixes #146. More tickets will be opened to continue work on this!

Summary of changes

@Kyles-MacBook-Pro ~/git/pan/psim/python git:(kkrol/psim-python|+4) venv:(3.7.7)
% python -m psim config --help
usage: psim config [-h] [-v] [-q] [--patch-dir PATCH_DIR]
                   [--output-dir OUTPUT_DIR] [--modules MODULES] [--readable]
                   CONFIG_DIR

Process PSim configuration files.

positional arguments:
  CONFIG_DIR            Configuration directory for the simulation. This is a
                        relative path from "python/psim/config" in the PSim
                        repository.

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         Enable verbose, debugging output.
  -q, --quiet           Disable all logging output except for fatal errors.
                        This will disable the verbose flag.
  --patch-dir PATCH_DIR, -p PATCH_DIR
                        Looks for an extra set of configuration files in the
                        patch directory. This search is not recursive and is
                        primarily intended to remove the effects on a Monte
                        Carlo configuration.
  --output-dir OUTPUT_DIR, -o OUTPUT_DIR
                        Output directory to dump the processed configuration
                        files in. This defaults to your current working
                        directory.
  --modules MODULES, -m MODULES
                        Comma separated list of modules to process
                        configuration files for. Defaults to all modules not
                        specified.
  --readable, -r        Enable cleaner JSON formatting for the resulting
                        output files.

Currently, I have just spot tested this will a couple of the configuration files included in this PR (they are garbage otherwise). The following tasks will be worked on to round out this PR:

Ptest Effects

None at the moment.

Testing

No tests are currently written for this. Will potentially add tests in the future (see comments above).

Constants

NA

Documentation Evidence

For the moment, inline documentation and the command line interface help should be sufficient.

kylekrol commented 4 years ago

This looks like it's the same PR from a few weeks ago (?), so I'll approve so that this could be merged. This is already a pretty big PR--to make the other components more easily reviewable could you split them into multiple PRs?

Sorry about that yes, it's largely the same expect I just tidied up the command line interface a bit and made the distinction between "per sat" config files and "global" config files. The following PRs should be smaller!