Skip to content

Three changes#3

Merged
sn6uv merged 5 commits intoImagefrom
unknown repository
May 25, 2016
Merged

Three changes#3
sn6uv merged 5 commits intoImagefrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented May 24, 2016

Gets rid ImageCreate[] and adds a real constructor rule to Image[], which means that under any circumstances an Image[] is now always an Image[] (which makes ImageQ[] possible, also included).

Adds support for classic Mathics branch (even though we're not on it, I'm aware, but with the change in Mathics.js the image class works there now perfectly and I now wonder if the whole image thing belongs there really, as the JavaScript processing there and in the future Jupyter notebook will be identical).

I also had an implementation for DominantColors[], but it needs scipy.spatial.KDTree, and I read the Google Groups link regarding scipy and your position on it. I'll try to sketch my position on this in a separate email.


def apply_no_image(self, array, evaluation):
'ImageQ[Image[array_]]'
return Symbol('False')
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

What happens when the argument doesn't match either pattern? I think a better way would be to inherit from Test and implement the test as isinstance(arg, Image)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That's more elegant in any case, I changed that.

@sn6uv sn6uv merged commit 0eca41b into sn6uv:Image May 25, 2016
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.

2 participants