Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ret_flag is a tuple in attempted comparisons #9

Open
DanielHHowell opened this issue Jan 23, 2021 · 3 comments
Open

ret_flag is a tuple in attempted comparisons #9

DanielHHowell opened this issue Jan 23, 2021 · 3 comments

Comments

@DanielHHowell
Copy link

Trying to get this succesfully deployed and running into issues with calculate.py where ret_flag is being used as a comparison operator but is a tuple, and not sure which of the 5 values is the relevant one

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-9-f6ffd9385682> in <module>
      4                                             DEFAULT_CONFIG)
      5 
----> 6     asset_natal_chart = calculate_chart(asset_natal_chart_input)
      7     dates_to_generate = list(StockPrices['CorrectedDate'])

/home/daniel/pyAstroTrader/pyastrotrader/__init__.py in calculate_chart(input_json)
     14     input_data = check_input(input_json)
     15     config = load_config(input_data)
---> 16     output = generate_chart(config, input_data)
     17     return output
     18 

/home/daniel/pyAstroTrader/pyastrotrader/calculate/calculate.py in generate_chart(config, input_data)
    137     output['input'] = input_data
    138     output['intermediate'] = intermediate
--> 139     output = calculate_planets(input_data, intermediate, output, config)
    140     output = calculate_main_chart(input_data, intermediate, output)
    141     output = calculate_planets_in_houses(output)

/home/daniel/pyAstroTrader/pyastrotrader/calculate/calculate.py in calculate_planets(input_data, intermediate, output, config)
     85                             'zodiac'][x] + ":" + str(x)
     86                     output['planets']['planets_degree'][
---> 87                         i] = ret_flag[0] - deg_low
     88                     output['planets']['planets_degree_ut'][i] = ret_flag[0]
     89                     if ret_flag[3] < 0:

TypeError: unsupported operand type(s) for -: 'tuple' and 'float'
@selBaez
Copy link

selBaez commented Apr 14, 2022

Hi @DanielHHowell Did you figure out what the correct comparison should be? I am running into the same problem :(

@selBaez
Copy link

selBaez commented Apr 14, 2022

@DanielHHowell I changed the line in calculate.py to

ret_flag, ret_flag_residual = swe.calc_ut(intermediate['jul_day_UT'], i, intermediate['iflag'])

Assuming that the tuple represents the values we actually want to convert. Hope it is correct!

@DanielHHowell
Copy link
Author

@selBaez did this get it working for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants