pylab import in rdesigneur affects the rest of the python script
Created by: iampritishpatil
Line 23 has import pylab in rdesignuer.py that implicitly imports matplotlib.
In case where matplotlib needs to be imported explicitly using a different backend, to do for example,
import matplotlib as mpl
mpl.use('agg') #sets agg as the backend
but rdesigneur is imported before, the rdesigneur matplotlib dominates and thus the backend is not set. This is particularly relevant when running files on the cluster when the backend of matplotlib should be non-gui.
Importing a matplolotlib before importing rdesigneur might be a temporary fix, but maybe there is a better way around this where the rdesigneur internals don't affect the rest of the python code.
#########################################################################
## rdesigneur0_5.py ---
## This program is part of 'MOOSE', the
## Messaging Object Oriented Simulation Environment.
## Copyright (C) 2014 Upinder S. Bhalla. and NCBS
## It is made available under the terms of the
## GNU General Public License version 2 or later.
## See the file COPYING.LIB for the full notice.
#########################################################################
##########################################################################
## This class builds models of
## Reaction-Diffusion and Electrical SIGnaling in NEURons.
## It loads in neuronal and chemical signaling models and embeds the
## latter in the former, including mapping entities like calcium and
## channel conductances, between them.
##########################################################################
from __future__ import print_function
import imp
import os
import moose
import numpy as np
import pylab
import math
import rmoogli
#import rdesigneurProtos
from rdesigneurProtos import *
from moose.neuroml.NeuroML import NeuroML
from moose.neuroml.ChannelML import ChannelML
import lxml
from lxml import etree
import h5py as h5
import csv