IBM Data & AI

Welcome to the idea forum for IBM Data & AI (Formerly Analytics) Clients! 


IBM Employees:

The correct URL for entering your ideas is



Our team welcomes any feedback  and suggestions you have for improving our offerings / products!  This forum allows us to connect your offering / product improvement ideas with IBM product and engineering teams.


If you have not registered on this portal please click on the following link and register.  To complete registration you will need to open the email you will receive from Aha to confirm your identity.


Support user-defined Python module

I would like to maintain a set of Python functions and classes in a separate model/script, then do an import from that module in a notebook and DO4DSX model.
Use cases:
* I want to move complex function definitions out of my notebook.
The functions take up a lot of screen space in the notebook and are not that relevant for the main topic of the notebook.
* I have multiple notebooks in the same project that want to share code.
* I have a set of functions/classes I want to re-use among multiple projects of possibly multiple users
This code is not stable and may need frequent updates and additions. Therefore, it would not be feasible to require the assistance of a DSX administrator to update the module.
Currently, DSX does support a custom module/script. It can be uploaded to the scripts directory and in DSX 1.2 it can be viewed and edited.
In addition, DSX supports the notion of a Library project to which other projects have access to.
Notebooks can import from a module in either the local scripts directory or a directory in the shared Library project.
But the DO4DSX model based on such notebook fails to run due to a failure to import the module.

In particular, I would like to create a set of re-usable functions that support DO4DSX optimization models.
Without this feature, I would have to copy and paste a large block of code in the top cells of a notebook. This is ugly and difficult to maintain.

  • VICTOR Terpstra
  • Dec 14 2018
  • Future Consideration
Customer Name
Role Summary Data Scientist
  • Attach files
  • Admin
    VIRGINIE Chassain commented
    December 14, 2018 17:59

    If scripts can be imported in notebook, it is true that it should as well be supported in model builders. Under consideration.

NOTICE TO EU RESIDENTS: per EU Data Protection Policy, if you wish to remove your personal information from the IBM ideas portal, please login to the ideas portal using your previously registered information then change your email to "anonymous@euprivacy.out" and first name to "anonymous" and last name to "anonymous". This will ensure that IBM will not send any emails to you about all idea submissions