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

missing 1 required argument: 'api_key' while experimenting basic API call #7

Open
ghost opened this issue Feb 25, 2019 · 2 comments
Open

Comments

@ghost
Copy link

ghost commented Feb 25, 2019

Hi,
Following the tutorial, I am using Ubuntu, exported the SOLCAST_API_KEY in shell, and in the python environment of execution of the script, if this makes any difference.

I encountred the following error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-16263a0dce87> in <module>
      7 # install_date | format: yyyyMMdd Will be ignored if a loss_factor is supplied
      8 # latest | [True, False] | default False
----> 9 power_estimated_actuals = PowerFrameHandler.estimated_actuals(location, 5000, azimuth=0)
     10 power_estimated_actuals.pv_estimate.plot()
     11 

~/Bureau/Untitled Folder 1/solcast_frames/powerframehandler.py in estimated_actuals(lat_Lng, capacity, **kwargs)
     19         :rtype: pd.DataFrame
     20         """
---> 21         data = sc.PvPowerEstimatedActuals(lat_Lng.lat, lat_Lng.lng, capacity, **kwargs).content["estimated_actuals"]
     22         new_frame = pd.DataFrame(data)
     23         new_frame.set_index(['period_end'], inplace=True)

~/.conda/envs/tf/lib/python3.6/site-packages/solcast/pv_power_estimated_actuals.py in __init__(self, latitude, longitude, capacity, *args, **kwargs)
     35             self.end_point = self.end_point + '/latest'
     36 
---> 37         self._get(*args, **kwargs)
     38 
     39         if self.ok:

~/.conda/envs/tf/lib/python3.6/site-packages/solcast/base.py in _get(self, api_key, **kwargs)
     23         if api_key == None:
     24             raise TypeError('{type}() missing 1 required argument: \'api_key\''\
---> 25                             .format(type=type(self)))
     26 
     27         logger = logging.getLogger()

TypeError: <class 'solcast.pv_power_estimated_actuals.PvPowerEstimatedActuals'>() missing 1 required argument: 'api_key'

Thank you.

@ghost ghost changed the title Experimenting basic API call missing 1 required argument: 'api_key' while experimenting basic API call while Feb 25, 2019
@ghost ghost changed the title missing 1 required argument: 'api_key' while experimenting basic API call while missing 1 required argument: 'api_key' while experimenting basic API call Feb 25, 2019
@Siliconrob
Copy link
Contributor

Siliconrob commented Feb 26, 2019

Thank you for bringing this up will run through the steps again to make sure Ubuntu is functioning as detailed.

Have you looked over the setup for the solcast-py library as it is used by this project?

@Siliconrob
Copy link
Contributor

This seems to work locally for me, can you run the following command on your terminal

printenv | grep SOLCAST_API_KEY and you should see something like this (have obfuscated the real key)

SOLCAST_API_KEY=Hz****

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

1 participant