Skip to content

Commit

Permalink
plot univariate distributions latex label fix (2.3.12 release) (#398)
Browse files Browse the repository at this point in the history
* fix bug in the latex labels on plots when converting from multivariate to univariate distributions.
  • Loading branch information
kecnry authored Dec 28, 2020
1 parent 63612f8 commit 1a39123
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ To understand how to use PHOEBE, please consult the [tutorials, scripts and manu
CHANGELOG
----------

### 2.3.12 - plot univariate distributions latex label fix

* fix bug in the latex labels on plots when converting from multivariate to univariate distributions.

### 2.3.11 - continue_from run_checks fix

* fix bug where run_checks raised an error for an empty init_from if continue_from was set.
Expand Down Expand Up @@ -349,4 +353,4 @@ an envelope were being raised before all constraints could resolve successfully.
QUESTIONS? SUGGESTIONS? CONCERNS?
---------------------------------

Contact us! Issues and feature requests should be submitted directly through GitHub's issue tracker. Two mailing lists are dedicated for discussion, either on user level ([[email protected]](mailto:phoebe-[email protected])) or on the developer level ([[email protected]](mailto:phoebe-[email protected])). We are eager to hear from you, so do not hesitate to contact us!
Contact us! Issues and feature requests should be submitted directly through GitHub's [issue tracker](https://github.com/phoebe-project/phoebe2/issues). Additional questions or feature requests should be submitted via [GitHub PHOEBE2 discussions](https://github.com/phoebe-project/phoebe2/discussions) or [GitHub PHOEBE2-UI discussions](https://github.com/phoebe-project/phoebe2-ui/discussions). We are eager to hear from you, so do not hesitate to [contact us](http://phoebe-project.org/help/contact)!
2 changes: 1 addition & 1 deletion phoebe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"""

__version__ = '2.3.11'
__version__ = '2.3.12'

import os as _os
import sys as _sys
Expand Down
26 changes: 23 additions & 3 deletions phoebe/dependencies/distl/distl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1893,7 +1893,14 @@ def label_latex(self):
The latex label of the distribution object. When not None, this is used for
the x-label when plotting (see <<class>.plot>).
"""
return r"$"+self._label_latex+"$" if self._label_latex is not None else self.label
if self._label_latex is not None:
if "$" not in self._label_latex:
return r"$"+self._label_latex+"$"
if "$$" in self._label_latex:
return self._label_latex.replace("$$", "$")
return self._label_latex
else:
return self.label

@label_latex.setter
def label_latex(self, label_latex):
Expand Down Expand Up @@ -3514,7 +3521,14 @@ def label_latex(self):
-------------
* string or None
"""
return r"$"+self._label_latex+"$" if self._label_latex is not None else self.multivariate.labels_latex[self.dimension] if self.multivariate.labels_latex is not None else None
if self._label_latex is not None:
if "$" not in self._label_latex:
return r"$"+self._label_latex+"$"
if "$$" in self._label_latex:
return self._label_latex.replace("$$", "$")
return self._label_latex
else:
return self.label

@label_latex.setter
def label_latex(self, label_latex):
Expand Down Expand Up @@ -7730,7 +7744,11 @@ def samples(self):

@property
def weights(self):
return self.multivariate.weights[:, self.dimension] if self.multivariate.weights is not None else None
if self.multivariate.weights is None:
return None
if len(self.multivariate.weights.shape) == 1:
return self.multivariate.weights
return self.multivariate.weights[:, self.dimension]

@property
def bw_method(self):
Expand Down Expand Up @@ -7984,6 +8002,8 @@ def label_latex(self):
if self._label_latex is not None:
if "$" not in self._label_latex:
return r"$"+self._label_latex+"$"
if "$$" in self._label_latex:
return self._label_latex.replace("$$", "$")
return self._label_latex
else:
return self.label
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ def _env_variable_bool(key, default):
long_description = "\n".join(long_description_s[long_description_s.index("INTRODUCTION"):])

setup (name = 'phoebe',
version = '2.3.11',
description = 'PHOEBE 2.3.11',
version = '2.3.12',
description = 'PHOEBE 2.3.12',
long_description=long_description,
author = 'PHOEBE development team',
author_email = '[email protected]',
Expand All @@ -367,7 +367,7 @@ def _env_variable_bool(key, default):
'Programming Language :: Python :: 3 :: Only',
],
python_requires='>=3.6, <4',
download_url = 'https://github.com/phoebe-project/phoebe2/tarball/2.3.11',
download_url = 'https://github.com/phoebe-project/phoebe2/tarball/2.3.12',
packages = ['phoebe', 'phoebe.parameters', 'phoebe.parameters.solver', 'phoebe.parameters.figure', 'phoebe.frontend', 'phoebe.constraints', 'phoebe.dynamics', 'phoebe.distortions', 'phoebe.algorithms', 'phoebe.atmospheres', 'phoebe.backend', 'phoebe.solverbackends', 'phoebe.solverbackends.ebai', 'phoebe.utils', 'phoebe.helpers', 'phoebe.pool', 'phoebe.dependencies', 'phoebe.dependencies.autofig', 'phoebe.dependencies.nparray', 'phoebe.dependencies.distl', 'phoebe.dependencies.unitsiau2015'],
install_requires=['numpy>=1.12','scipy>=1.2','astropy>=1.0', 'corner', 'pytest', 'requests', 'python-socketio[client]']+['flask', 'flask-cors', 'flask-socketio', 'gevent-websocket'],
package_data={'phoebe.atmospheres':['tables/wd/*', 'tables/passbands/*'],
Expand Down

0 comments on commit 1a39123

Please sign in to comment.