code: def scalarVectorDecorator(func):
      
      @wraps(func)
      def scalar_wrapper(*args,**kwargs):
          if numpy.array(args[1]).shape == () \
                  and numpy.array(args[2]).shape == (): #only if both R and z are scalars
              scalarOut= True
              args= (args[0],numpy.array([args[1]]),numpy.array([args[2]]))
          elif numpy.array(args[1]).shape == () \
                  and not numpy.array(args[2]).shape == (): #R scalar, z vector
              scalarOut= False
              args= (args[0],args[1]*numpy.ones_like(args[2]),args[2])
          elif not numpy.array(args[1]).shape == () \
                  and numpy.array(args[2]).shape == (): #R vector, z scalar
              scalarOut= False
              args= (args[0],args[1],args[2]*numpy.ones_like(args[1]))
          else:
              scalarOut= False
          result= func(*args,**kwargs)
          if scalarOut:
              return result[0]
          else:
              return result
      return scalar_wrapper
docs: Decorator to return scalar outputs as a set