Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an 'oldagg' backend pointing to kiva.agg #669

Merged
merged 2 commits into from
Mar 10, 2021

Conversation

jwiggins
Copy link
Member

@jwiggins jwiggins commented Mar 3, 2021

This is step 3 from #414. Before switching the image kiva backend to celiagg, we need to make kiva.agg accessible via an unambiguous name.

@corranwebster
Copy link
Contributor

Do we want a kiva/oldagg.py as well? For now it could just import everything from kiva.image.

@jwiggins
Copy link
Member Author

jwiggins commented Mar 3, 2021

Come to think of it, we might...

Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes in this PR LGTM but i'm a bit confused about what the next step will be. I thought the idea was to use kiva.celiagg instead of kiva.agg in enable.<toolkit>.image. IIUC, that doesn't work with the proposed changes in this PR. Right?

@jwiggins
Copy link
Member Author

jwiggins commented Mar 9, 2021

I'm not sure we're ready to "throw the switch" yet, so it's not being done in this PR

# is also available online at http://www.enthought.com/licenses/BSD.txt
#
# Thanks for using Enthought open source!
from .image import (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is similar to Rahul's question, but why do we pull from .image not .agg in these?

Because if we eventually have image point to celiagg, then oldagg effectively becomes an alias for celiagg not agg?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.agg doesn't exist. That's what .image is. It's kiva.agg. When .image points to celiagg, this module will be filled with the old contents of .image.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.agg doesn't exist.

I am still a little confused. how does the code in kiva/image.py work then as it seems to just import from .agg, see:

from .agg import GraphicsContextArray as GraphicsContext

My understanding was that image was basically just an alias pointing at agg, and it would move to point to celiagg in the future (ie those imports change to .celiagg).

If the image contents are going to eventually be moved into these oldagg modules when .image points to celiagg that makes sense. But the image contents seem to be pulling from .agg so it would make sense to me if these files effectively just copied that code over now rather than later?

I believe I am still missing something

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. We're talking past each other a little bit here. .image is very ambiguous here. Are you talking about kiva.image, enable.null.image, enable.qt4.image, or enable.wx.image? When you make a comment on the file enable.null.oldagg and use the name .image, then I'm sure you're talking about enable.null.image. I'm also sure that .agg does not exist in this context, because there is no such thing as enable.null.agg.

I guess I thought it would be simpler to just have these new oldagg modules get their imports directly from their image neighbors on the odd chance that an image module gets updated before the celiagg switchover.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahhh I see, my mistake, that makes sense now
thank you!

Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. IIUC, the next step (which we will do at somepoint in the future) is to move the contents of *.image into the *.oldagg modules and import *.celiagg stuff into the *.image modules. Is that correct John?

@jwiggins
Copy link
Member Author

That is correct

@rahulporuri
Copy link
Contributor

Still LGTM

@jwiggins jwiggins merged commit eecba7f into master Mar 10, 2021
@jwiggins jwiggins deleted the feature/introducing-oldagg branch March 10, 2021 11:44
@jwiggins
Copy link
Member Author

Thanks for the reviews

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants