Decision Optimization utilities for IBM Cloud Pak for Data projects
Project description
DSE_DO_Utils
Decision Optimization utilities for IBM Cloud Pak for Data projects.
Source (GitHub)
Documentation (GitHubPages)
This repository contains the package dse_do_utils
. This can be installed using pip.
Important
From v0.5.0.0, the dse-do-utils require the package decision-optimization-client==1.0.0 and no longer the former dd-scenario. This package is NOT installed by default, neither in CPD3.5 not CPD4.0. DSE-DO-Utils v0.5.0.0 works in both CPD 3.5 and 4.0. dd-scenario works in CPDv3.5, but NOT in CPDv4.0.
Main classes:
- ScenarioManager. Reads and writes table data from and to all combinations of csv-files, Excel spreadhseet and DO scenario.
- DataManager. A DataManager is mostly a container for data and functions for pre- and post-processing. Can be subclassed and stored in a script to be able to share code between multiple notebooks. Also contains some utilities for data manipulation, like the crossjoin.
- OptimizationEngine. Also mostly a container for functions around creating an optimization model and using the docplex APIs. Can be subclassed and stored in a script to be able to share code between multiple notebooks. Also contains some functions to create dvars and export .lp files.
- ScenarioPicker. Interactively pick an existing scenario from a drop-down menu in a notebook. Typically used in visualization notebooks.
- MapManager. For creating map visualizations using Folium.
Installation on CPDv4.5
For Cloud Pak for Data v4.5.
Install in customized environment
CPDv4.5 allows for easy customization of environments. Add the following to the customization configuration:
channels:
dependencies:
- pip
- pip:
- dse-do-utils==0.5.5.0
- decision-optimization-client==1.1.0
This automatically downloads dse-do-utils from PyPI and installs the package.
For air-gapped systems that have no access to PyPI:
- Download the package from PyPI/Conda from an internet connected system as a wheel/zip file
- Upload the wheel/zip as a data asset, or place in any location in the JupyterLab file system
- Add a pip dependency in the environment yaml:
dependencies:
- pip:
- file:///userfs/packages/dse_do_utils-0.5.4.5b4-py3-none-any.whl
This downloads the package as a wheel/zip and puts it in the data assets
!pip download dse-do-utils -d /project_data/data_asset/
Then move the wheel/zip to the Data Assets.
See the InstallationReadMe.md
for more details on installation and usage in other cases.
Import
Then import the required classes from dse_do_utils
:
from dse_do_utils import ScenarioManager, DataManager
This is the basics. For many ore details on other usage, see InstallationReadMe.md
Target environments
To be used within:
- CP4D on-prem v4.0 and up
- CP4DaaS / WS Cloud (version 0.4.0.0 and up)
DO Model Builder and WML environments
When developing and using optimization models, there are 3 different environments the Python DO model might run in:
- A notebook environment.
- The DO Model Builder environment.
- The WML deployment environment.
From CP4D 4.6, all environments can be customized from PyPI packages and wheel files
Scope of classes/modules
The classes OptimizationEngine
and DataManager
are intended to be used within the optimization model code
that will run in the Model Builder and WML deployment. All other classes, in particular the ScenarioManager
are
designed to be used outside of the Model Builder or WML, e.g. within #dd-ignore
cells.
Requirements
This package requires:
- decision-optimization-client. This package provides an interface to the DO scenarios. This package is available in PyPI, however it only runs within CP4D/CP4DaaS.
- docplex. This package interfaces with the CPLEX and CP Optimizer optimization engines.
- folium. Map visualization. Only for the MapManager.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dse_do_utils-0.5.7.0.tar.gz
.
File metadata
- Download URL: dse_do_utils-0.5.7.0.tar.gz
- Upload date:
- Size: 100.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93788683c5c4c8009c3e071f692f4ad47ec3d71ba78d20745bd77a396cd82352 |
|
MD5 | 3a60137c4a7e88a7a9dd4996a2ed8fb8 |
|
BLAKE2b-256 | b488e7a57fb7bd7eb14613d8c9b2a4db84d7a648db2cc213a151ed85e60c6667 |
File details
Details for the file dse_do_utils-0.5.7.0-py3-none-any.whl
.
File metadata
- Download URL: dse_do_utils-0.5.7.0-py3-none-any.whl
- Upload date:
- Size: 139.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10802d33ba71529788496f861738cba8fdbcccff68fb2834d83dcd996426c0b9 |
|
MD5 | c907e348325605c0a78cb8c7e3509722 |
|
BLAKE2b-256 | 771f5b90ca2905bea27ef1cc1c3fa7b96950397e684b057b474363aa9f734945 |