TrishGillett / pysdpt3glue

Glue code for solving semidefinite programs in Cvxpy format using the SDPT3 package for Matlab.
MIT License
13 stars 3 forks source link

Refactoring package. #24

Closed jkawamoto closed 8 years ago

jkawamoto commented 8 years ago

This PR has some refactoring. At first, three exception classes are merged to one so that users don't need to catch each exception. For example,

try:
    # executing matlab or octave depending on environment.
except MatlabCallError:
    # error handling for matlab case.
except OctaveCallError:
    # error handling for octave case.

can handle each case but I think there are less difference in both case. Thus,

try:
    # executing matlab or octave depending on environment.
except SubprocessCallError:
    # general error handling 
    if matlab:
        # for matlab case.
    else:
        # for octave case.

seems enough.

Next, keylist has been made each time calling make_result_dict. I moved it to a kind of constant. However, there could be a discussion like global constant vs. local variables, i.e. should we avoid global constants.

I also added new lines to messages I've forgotten.