Upgrade to 3.0.0
Version 3.0.0 connects to the Volue Data & Forecasts API at
https://data-forecasts.volue.com. Versions before 3.0.0 do not work with
this address, even if you change urlbase in your config file: they call
API paths that data-forecasts.volue.com does not serve. Upgrade to 3.0.0.
Do the steps in this order.
1. Install version 3.0.0
Section titled “1. Install version 3.0.0”Check that your Python version is supported. See Installation.
If you use the wapi-python package, uninstall it first:
pip uninstall wapi-pythonInstall the library with the pandas extra:
pip install -U "volue-insight-timeseries[pandas]~=3.0"~=3.0 installs the latest 3.x release, but not 4.0 or later. A new major
version can contain breaking changes, so upgrade to it only after you have
checked it.
If you use a requirements.txt file, limit it to the same major version:
volue-insight-timeseries[pandas]~=3.0The pandas extra installs pandas. Without it, functions such as
TS.to_pandas() raise an ImportError. Leave out [pandas] only if your
code does not use these functions. See
pandas support.
2. Update your code (wapi-python only)
Section titled “2. Update your code (wapi-python only)”If your code already imports volue_insight_timeseries, skip this step.
Change the imports:
| wapi-python | volue-insight-timeseries |
|---|---|
import wapi |
import volue_insight_timeseries as vit |
wapi.Session(...) |
vit.Session(...) |
from wapi.util import TS |
from volue_insight_timeseries.util import TS |
from wapi.curves import InstanceCurve |
from volue_insight_timeseries.curves import InstanceCurve |
Time zones use zoneinfo,
not pytz. TS.tz is a zoneinfo.ZoneInfo object. Replace pytz code:
| pytz | zoneinfo |
|---|---|
pytz.timezone('CET') |
ZoneInfo('CET') |
tz.localize(d) |
d.replace(tzinfo=tz) |
tz.normalize(d) |
not needed, remove it |
All other calls, such as search, get_curve, get_data, get_latest and
events, stay the same.
3. Remove the old address
Section titled “3. Remove the old address”In your config file, delete the urlbase line:
[common]urlbase = https://api.volueinsight.comauth_type = OAuthtimeout = 300
[OAuth]id = client_idsecret = client_secretauth_urlbase = https://auth.volueinsight.comThe library then uses https://data-forecasts.volue.com. Keep
auth_urlbase and your credentials as they are.
If you pass urlbase in code, remove it:
session = vit.Session(config_file='config.ini')If urlbase still points to api.volueinsight.com, the library shows a
FutureWarning when you create the session. The calls work until the
cutoff in the
migration timeline.
4. Open your firewall
Section titled “4. Open your firewall”If your network limits outbound traffic, allow HTTPS (port 443) to:
data-forecasts.volue.comapp.data-forecasts.volue.com
5. Check the connection
Section titled “5. Check the connection”import volue_insight_timeseries as vit
session = vit.Session(config_file='config.ini')print(session.urlbase) # https://data-forecasts.volue.comprint(len(session.get_areas())) # a number above 0If both lines print as shown, the upgrade is complete.