Comments (3)
I did some searching and found one more callback with a similar issue: calling annotate_arrow()
then another function that runs the callback changes the arrow size.
yt/yt/visualization/plot_modifications.py
Lines 1802 to 1812 in 14c49c4
from yt.
Looks like this is because the callback overwrites the radius
attribute with a scaled version, which changes the units from length to either dimensionless value or 1/length. So when it runs back through the callback (cause calling set_font_size
invalidates the plot), the radius
attribute will be the already-scaled value with units that can't convert to dimensions of length.
if is_sequence(self.radius):
self.radius = plot.data.ds.quan(self.radius[0], self.radius[1])
self.radius = np.float64(self.radius.in_units(plot.xlim[0].units))
if isinstance(self.radius, YTQuantity):
if isinstance(self.center, YTArray):
units = self.center.units
else:
units = "code_length"
self.radius = self.radius.to(units)
# This assures the radius has the appropriate size in
# the different coordinate systems, since one cannot simply
# apply a different transform for a length in the same way
# you can for a coordinate.
if self.coord_system == "data" or self.coord_system == "plot":
self.radius = self.radius * self._pixel_scale(plot)[0]
else:
self.radius /= (plot.xlim[1] - plot.xlim[0]).v
simplest fix would be to not overwrite self.radius
. but could also add a self._scaled_radius
attribute to avoid re-calculating if it's already been through once? I'll keep playing around and push something up shortly.
from yt.
Thanks @yut23 ! I was curious if there'd be any others that failed when invalidated and run again, looks like the arrow callback fails for the same reason (storing calculations in class attributes). I'll add the fix to my current PR
from yt.
Related Issues (20)
- suspected bug in Projection Plots for SPH datasets HOT 2
- BUG: defect in polar coordinate handler breaks fixed-resolution buffer HOT 2
- BUG: accessing data in re-loaded sphere object errors HOT 1
- BUG: Order of Cylindrical Coordinates for Athena++ Incorrect HOT 6
- TST: `yt/tests/test_load_archive.py::test_load_archive` is failing HOT 1
- Possible bug: eps_writer doesn't retain formatting of SlicePlot object HOT 6
- Error while rendering SpectralCube with non-square face: IndexError while reading fields HOT 1
- pooch HOT 2
- TST: GAMER answer tests are failing HOT 6
- DOC/DEPR: eps_writer's documentation is misleading
- octree total gas masses improperly inversely scaling with nref HOT 11
- Off axis Slice Plot breaks when using derived field and default center HOT 1
- DOCS: adding/updating a list of external frontends (and extensions) HOT 3
- (not a BUG): flip_horizontal and flip_vertical with multipanel plots not working HOT 1
- TST: Upcoming dependency test failures HOT 3
- Question: expected behavior of center argument in slices of spherical datasets? HOT 3
- TST: Upcoming dependency test failures HOT 1
- TST: Upcoming dependency test failures HOT 2
- TST: incompatibilities with pytest 8 (tracking issue)
- bug/not implemented problem: annotate_contour does not work with GIZMO MFM output HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yt.