convexengineering / gpfit

Fit posynomials to data
http://gpfit.readthedocs.io/en/latest/
MIT License
10 stars 7 forks source link

different attributes in different installations #74

Closed iclucho closed 3 years ago

iclucho commented 7 years ago

Hi all,

I'm using gpfit in two different machines. After I run a fitting routine in my data I get certain attributes for the output. The "good" machine shows:

pr.pprint(smafit.__dict__.keys())
['posymap',
 'mfac',
 'ivar',
 'constraint',
 'evaluate',
 'dvars',
 'numpy_bools',
 'bounds',
 'substitutions',
 'max_err',
 'fitdata',
 'varkeys',
 'rms_err']

Whereas the "bad" machine shows:

pr.pprint(smafit.__dict__.keys())
['oper',
 'unsubbed',
 'right',
 'evaluate',
 'nomials',
 'substitutions',
 'p_lt',
 'varkeys',
 'm_gt',
 'last_used_substitutions',
 'left']

I use the fitdata attribute to extract the coefficients in a nice way and import them im MATLAB for post-processing. Why is the attribute list so different in these two installations? I cloned gpfit today in the old (bad) machine to see if there was any update but it doesn't see to affect the attribute list. None of the attributes available in the "bad" machine contains the coefficient in a nice format for extraction.

bqpd commented 7 years ago

Hi @iclucho ! Both objects are created with the same code?

If so my guess it's that they're different versions of gpfit; we added the FitConstraintSet class pretty recently, and it looks like that's what you're seeing in the former, while the latter is probably a standard ArrayConstraintSet. What does type(smafit) show for each of them?

iclucho commented 7 years ago

Hi bqpd. Thanks for your reply.

Indeed, both objects are generated with the same code. At the moment I only have access to the "bad" machine. There, when typing type(smafit), I get:

<class 'gpfit.fit_constraintset.FitCS'>

I recloned the gpfit version today to see if it would make a difference but so far nothing.

EDIT: Nevermind, I started python in a different terminal and the newly cloned version also contains the fitdata attribute.

bqpd commented 7 years ago

Great! Yeah, looks like that's the newest version: https://github.com/hoburg/gpfit/blob/master/gpfit/fit_constraintset.py#L15

It might not be on pypi yet, so if you installed the 'bad' version with pip install gpfit, that could explain it.

bqpd commented 7 years ago

Sorry for the version confusion! GPfit hasn't had a proper owner/maintainer for a year; I'll hopefully be stepping to get it better documented /organized / etc this Fall.

pgkirsch commented 3 years ago

Created #92 to add to PyPI