Skip to content

Plug elements in 0.1.* API#207

Merged
ocefpaf merged 37 commits intopython-visualization:masterfrom
BibMartin:elements
Oct 25, 2015
Merged

Plug elements in 0.1.* API#207
ocefpaf merged 37 commits intopython-visualization:masterfrom
BibMartin:elements

Conversation

@BibMartin
Copy link
Copy Markdown
Contributor

(the 36 first commits are the same as #203)

As written in #203, this breaks the 0.1.* code in order to plug elements.py.

A few tests are passing and a lot of them are failing.

The goal is to adapt/pass the 30 existing test and ensure :

  • that you can still use the former API, with deprecation warnings
  • that the new API si used everywhere in the background.

@ocefpaf
Copy link
Copy Markdown
Member

ocefpaf commented Sep 9, 2015

@BibMartin you are accumulating a lot of work here and it is getting hard to review as time passes. Yous plans are to merge #203 first, right?

@BibMartin
Copy link
Copy Markdown
Contributor Author

@ocefpaf Yes, I plan to have #203 merged and then rebase this one to hide the commits they have in common.
btw : this PR is indeed half-finished (I opened it to give visibility on where I'm going) ; I expect (hope) it will be easier to review when finished.

@ocefpaf
Copy link
Copy Markdown
Member

ocefpaf commented Sep 9, 2015

I expect (hope) it will be easier to review when finished.

Thanks! The problem to review is on my side. (Lack of time 😒)

@BibMartin
Copy link
Copy Markdown
Contributor Author

Can you please have a look at former commit (BibMartin@6832e24). I wonder whether these two tests (test_geo_json_bad_color and test_geo_json_bad_threshold_scale) are still useful ❓

@ocefpaf
Copy link
Copy Markdown
Member

ocefpaf commented Sep 14, 2015

Both test_geo_json_bad_color and test_geo_json_bad_threshold_scale are probably * no longer useful. They might be in a choropleth method that may or may not be derived from the geo_json method. I still need to think a little bit more on how to do this properly.

* I got a GitHub Sorry, this diff is temporarily unavailable due to heavy server load.

@BibMartin
Copy link
Copy Markdown
Contributor Author

@ocefpaf

They might be in a choropleth method that may or may not be derived from the geo_json method. I still need to think a little bit more on how to do this properly.

For the moment you can do a choropleth in doing

m = Map(...)
g = GeoJson(...)                   # Create the geo_json shapes
g.add_children(GeoJsonStyle(...)   # Define the colouring
m.add_children(g)
m.add_children(ColorScale(...))    # Set the legend

Of course, we will need a shortcut method. Maybe simply

m = Map(...)
m.add_children(GeoJson(..., style=GeoJsonStyle(...), legend=ColorScale(...)))

Or as before, m.geo_json(...) is not crazy to me.

@ocefpaf
Copy link
Copy Markdown
Member

ocefpaf commented Sep 15, 2015

Or as before, m.geo_json(...) is not crazy to me.

The thing is. We either let the user be responsible for ColorScale or we create a convenience choropleth method to adjust the ColorScale automatically*. I would like geo_json to just add the GeoJSON assuming very little about the underlying data.

* We could even use some of PySAL methods to determine the ColorScales.

@BibMartin
Copy link
Copy Markdown
Contributor Author

✅ Green at last ! And ready for review...
@ocefpaf @themiurgo if you have time...

@ocefpaf
Copy link
Copy Markdown
Member

ocefpaf commented Oct 6, 2015

Awesome! I will take a look before the weekend.

Thanks a lot for the hard work @BibMartin!

Comment thread folium/features.py
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess you do not need that slash. right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I guess you're right. It's a (bad?) habbit I took not to rely on brackets for multi-line.
Tell me and I'll put them away.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd rather not have them there. But that is just cosmetics... We still need a better review than mine to get this merged as soon as possible!

@ocefpaf
Copy link
Copy Markdown
Member

ocefpaf commented Oct 18, 2015

I am 👍

However, I am a bit overwhelmed with all the changes and I'd really appreciate more eyes on this PR before we get it merged.

@themiurgo Do you think you can take a quick look at this? If not, @BibMartin since it has been so long you wrote this I guess you are now an independent observer of your own code 😛 so take a second look and give me the green to merge.

@BibMartin
Copy link
Copy Markdown
Contributor Author

Thanks @ocefpaf for first review.

If not, @BibMartin since it has been so long you wrote this I guess you are now an independent observer of your own code 😛 so take a second look and give me the green to merge.

I will try the exercise, but I would be more confident if @themiurgo had time to comment : it's not only technical changes but also a different mindset ; I can challenge my code, but barely my own philosophy

@ocefpaf
Copy link
Copy Markdown
Member

ocefpaf commented Oct 24, 2015

Last call for reviews 😉

Merging this Tomorrow!

ocefpaf added a commit that referenced this pull request Oct 25, 2015
Plug elements in `0.1.*` API
@ocefpaf ocefpaf merged commit 4315bd5 into python-visualization:master Oct 25, 2015
@ocefpaf
Copy link
Copy Markdown
Member

ocefpaf commented Oct 25, 2015

Thanks @BibMartin 🎉

@BibMartin BibMartin deleted the elements branch December 7, 2015 11:03
@ocefpaf ocefpaf added the enhancement Feature request or idea about how to make folium better label Feb 12, 2016
@ocefpaf ocefpaf added this to the v0.2.0 milestone Feb 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Feature request or idea about how to make folium better

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants