SIMULATOR-WG / SHARC

Simulator for use in sharing and compatibility studies of wireless communication systems
GNU Affero General Public License v3.0
15 stars 34 forks source link

Error using the math.inf in atmosphere.py #86

Open wiless opened 6 years ago

wiless commented 6 years ago

Description

Trying to run through main_cli.py with parameter.ini

What I Did

Paste the command(s) you ran and the output. If there was a crash, please include the traceback here.

~/SHARC/sharc$ python3 main_cli.py parameters/parameters.ini 
Traceback (most recent call last):
  File "main_cli.py", line 54, in <module>
    main(sys.argv[1:])
  File "main_cli.py", line 49, in main
    view_cli.initialize(param_file)
  File "../sharc/gui/view_cli.py", line 27, in initialize
    param_file = param_file)
  File "../sharc/controller.py", line 49, in action
    self.simulation_thread.run()        
  File "/home/ssk/SHARC/sharc/thread_simulation.py", line 53, in run
    self.model.initialize()
  File "../sharc/model.py", line 48, in initialize
    self.simulation = SimulationDownlink(self.parameters)
  File "../sharc/simulation_downlink.py", line 21, in __init__
    super().__init__(parameters)
  File "../sharc/simulation.py", line 48, in __init__
    self.propagation_system = PropagationFactory.createPropagation(self.param_system.channel_model, self.parameters)
  File "../sharc/propagation/propagation_factory.py", line 41, in createPropagation
    return PropagationP619()
  File "../sharc/propagation/propagation_p619.py", line 32, in __init__
    self.scintillation = Scintillation()
  File "../sharc/propagation/scintillation.py", line 21, in __init__
    self.atmosphere = ReferenceAtmosphere()
  File "../sharc/propagation/atmosphere.py", line 17, in __init__
    self.ref_atmosphere_altitude_km = [-math.inf, 11, 20, 32, 47, 51, 71]
AttributeError: 'module' object has no attribute 'inf'

I was able to run by this fix though

@@ -14,7 +14,7 @@ class ReferenceAtmosphere:
     """
     def __init__(self):
         # Table C.1 of ITU-R P619 - Constants for the reference dry atmosphere
-        self.ref_atmosphere_altitude_km = [-math.inf, 11, 20, 32, 47, 51, 71]
+        self.ref_atmosphere_altitude_km = [-float('inf'), 11, 20, 32, 47, 51, 71]