Skip to content

Commit

Permalink
support rendering on headless backends by not using enable_depth_peeling
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolasibalic committed Jan 1, 2024
1 parent 8fab482 commit f7f880a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ifigures/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.2.4"
__version__ = "0.2.5"

from .interact import InteractiveFigure
from .widgets import RadioWidget, RangeWidget, RangeWidgetViridis, DropDownWidget
Expand Down
6 changes: 4 additions & 2 deletions ifigures/amoplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pyvista as pv
from io import BytesIO
from PIL import Image
from os import environ


class EnergyLevels:
Expand Down Expand Up @@ -708,7 +709,7 @@ def plot(self, axis=None, debug=False,
],
labelOffset=None
):
"""Plots Bloch sphere on the given axis.
r"""Plots Bloch sphere on the given axis.
Args:
axis (_type_, optional): _description_. Defaults to None.
Expand All @@ -720,7 +721,8 @@ def plot(self, axis=None, debug=False,
label (list, optional): _description_. Defaults to [r"$|e\rangle$", r"$|g\rangle$", r"$\frac{|e\rangle+|g\rangle}{\sqrt{2}}$", r"$\frac{|e\rangle+i|g\rangle}{\sqrt{2}}$" ].
labelOffset (_type_, optional): _description_. Defaults to None.
"""
self.p.enable_depth_peeling(10)
if environ.get("PYVISTA_OFF_SCREEN") != "true":
self.p.enable_depth_peeling(10)
self.p.camera_position = cameraPosition
# [(13.0, 0.0, 1.0),
# (0.0, 0.0, 0.0),
Expand Down
3 changes: 1 addition & 2 deletions ifigures/timelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,7 @@ def saveStaticFigure(self, folderName:str):
with open(latexFile, 'w') as f:
f.write(eventsLaTeX)

print("Add generated folder and this line to use timeline in LaTeX:\n\input{%s}"
% latexFile)
print(f"Add generated folder and this line to use timeline in LaTeX:\n\input{latexFile}")
return


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "interactive-publishing"
version = "0.2.4"
version = "0.2.5"
description = "Templates and tools for creating interactive figures and interactive text for publishing in EPUB3/HTML5."
authors = ["Nikola Sibalic <nikolasibalic@physics.org>"]
license = "BSD-3-Clause license"
Expand Down

0 comments on commit f7f880a

Please sign in to comment.