ut-astria / orbdetpy

Orbit Determination with Python
https://ut-astria.github.io/orbdetpy
GNU General Public License v3.0
115 stars 38 forks source link

testsim.py TypeError: unexpected keyword argument #10

Closed jrmueting closed 5 years ago

jrmueting commented 5 years ago

After successfully pip installing orbdetpy and its dependencies, running the example sim data generation command:

python ../testsim.py radar_sim_cfg.json sim_data.json throws the following error:

TypeError: simulateMeasurements() got an unexpected keyword argument 'output_file'

Engineero commented 5 years ago

I can't reproduce this error. Are you using the most recent release? Looking at the source there is definitely an allowed output_file keyword argument in simulateMeasurements().

jrmueting commented 5 years ago

Yes just pulled the repo less than a week ago. The source I have does have the output_file keyword argument as well:

import os
import sys
import time
import argparse
from orbdetpy import simulateMeasurements

def main(args):
    print("Simulation start : %s" % time.strftime("%Y-%m-%d %H:%M:%S"),
          flush=True)
    simulateMeasurements(args.config, output_file = args.output)
    print("Simulation end   : %s" % time.strftime("%Y-%m-%d %H:%M:%S"))

if __name__ == '__main__':
    parser = argparse.ArgumentParser(
        description='Test script for simulating measurement output.')
    parser.add_argument('config', help='Path to config file.')
    parser.add_argument('output', help='Path to output file.')
    args = parser.parse_args()
    main(args)

If it matters, I had a lot of issues getting pyjnius to install. I had to try different versions of JDK until one worked. That was the only roadblock I encountered in installing orbdetpy.

Engineero commented 5 years ago

What version of JDK are you using now? I have found that 1.8 works, 1.12 does not, but I haven't tried everything else that's out there.

Regardless, this doesn't sound like a JDK or pyjnius issue. Actually this error doesn't make any sense to me at all, so maybe it is one of those messing with the Python magic.

Are you installing directly from PyPI with pip? Could you try cloning the master branch of the repository and installing from there? If that works it narrows down that the issue must be in the latest tagged release on PyPI.

git clone https://github.com/ut-astria/orbdetpy.git
pip uninstall orbdetpy
pip install ./orbdetpy
jrmueting commented 5 years ago

That worked! Yes I think the problem rests with the latest release with PyPi. Thank you!

JFYI, JDK 8 and 12 did not play well with pyjnius for me, but JDK 11 did.

Engineero commented 5 years ago

Roger, thanks. I will try to get a new release pushed with the latest code. I will mark this as closed when that is complete.

Engineero commented 5 years ago

Version 0.2.2 is live on PyPI. Should include the fixed examples.