From eric at intellovations.com Thu Mar 1 17:44:51 2018 From: eric at intellovations.com (Eric Floehr) Date: Thu, 1 Mar 2018 17:44:51 -0500 Subject: [CentralOH] Python Graph Help Message-ID: All, I'm trying to determine which python graphing library would be able to make the following graph type. I don't have a name for it, but here is the description... It's basically a vertical or horizontal line on some scale, with shaded rectangles over parts of it indicating certain things, and a triangle with a specific number pointing to that spot on the line. The closest example is the original Star Trek sick bay charts, and I found an example here: https://blogs.sas.com/content/sastraining/files/2017/06/startrek_med_dashboard_tips.gif Any thoughts? Thanks so much! Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From damiencalloway at gmail.com Thu Mar 1 18:57:42 2018 From: damiencalloway at gmail.com (Damien Calloway) Date: Thu, 01 Mar 2018 23:57:42 +0000 Subject: [CentralOH] Miscellany and Sundry - CohPy February 2018 Meeting Message-ID: PyOh Harry- works with scrappy Daniel - visited from Chicago Jessie - introduced herself as the Cake Batter Martini Geek, her instructor from CSCc also came out PyCon - may fill up by the end of March Neil - needs a large wheeled suitcase for the books Andrew spoke about enums Typesafe, compared to the alternatives in the static compiled languages Implemented in Python via enums module Btw, you NOT use floating points to do indexing ? Flags and bit flags ! Finite means that you can name them all ? Itertools ?starmap Travis spoke about Curio ? David Beasley ? Beazley ! Needs Python 3.5 Curio uses cooperative multitasking, ala Mac System 6 (classic Mac OS) We got to part 9 of the tutorial Enums - https://docs.python.org/3/library/enum.html Curio - https://curio.readthedocs.io/en/latest/ Cake batter martini - https://www.thespruce.com/cake-batter-martini-4134004 Thanks to Pillar for hosting -------------- next part -------------- An HTML attachment was scrubbed... URL: From herrold at owlriver.com Thu Mar 1 18:11:22 2018 From: herrold at owlriver.com (R P Herrold) Date: Thu, 1 Mar 2018 18:11:22 -0500 (EST) Subject: [CentralOH] cohPy] Python Graph Help In-Reply-To: References: Message-ID: On Thu, 1 Mar 2018, Eric Floehr wrote: > It's basically a vertical or horizontal line on some scale, with shaded > rectangles over parts of it indicating certain things, and a triangle with > a specific number pointing to that spot on the line. In financial markets trading one sees such. They are commonly referred to as 'candlesticks', as they seem to have 'wicks' up or down, and then a body, and finally a 'present price' indication ... also called 'box and whisker' plots http://tinyurl.com/y8fmjucd Formerly I would have sent you to gnuplot.info to see a sample, which was hosted at SourceForge .. but SourceForge seems ... to have died ??? http://gnuplot.sourceforge.net/demo/candlesticks.html undated content: Sourceforge project sites are currently under maintenance. Please check back later. We thank you for your patience. -- Russ herrold From eric at intellovations.com Thu Mar 1 20:50:25 2018 From: eric at intellovations.com (Eric Floehr) Date: Thu, 1 Mar 2018 20:50:25 -0500 Subject: [CentralOH] cohPy] Python Graph Help In-Reply-To: References: Message-ID: Thanks Russ! Candlesticks may work but they aren't exactly what I'm looking for. I'm really looking for something that looks like the graphics in the image I linked. Basically a ruled line with a shaded area and a triangle pointing to a specific value. Cheers, Eric On Thu, Mar 1, 2018 at 6:11 PM, R P Herrold wrote: > On Thu, 1 Mar 2018, Eric Floehr wrote: > > > It's basically a vertical or horizontal line on some scale, with shaded > > rectangles over parts of it indicating certain things, and a triangle > with > > a specific number pointing to that spot on the line. > > In financial markets trading one sees such. They are commonly > referred to as 'candlesticks', as they seem to have 'wicks' up > or down, and then a body, and finally a 'present price' > indication ... also called 'box and whisker' plots > > http://tinyurl.com/y8fmjucd > > Formerly I would have sent you to gnuplot.info to see a > sample, which was hosted at SourceForge .. but SourceForge > seems ... to have died ??? > > http://gnuplot.sourceforge.net/demo/candlesticks.html > > undated content: > > Sourceforge project sites are currently under maintenance. > Please check back later. We thank you for your patience. > > -- Russ herrold > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kedlav at gmail.com Thu Mar 1 21:33:46 2018 From: kedlav at gmail.com (Max) Date: Thu, 1 Mar 2018 21:33:46 -0500 Subject: [CentralOH] Python Graph Help In-Reply-To: References: Message-ID: You could probably manipulate the linear gauge charts in plotly to come close to that: https://plot.ly/python/linear-gauge-chart/ Coloring to suit is fairly easy and plotly documents that very well. I'm less certain on how to switch to using an external triangle instead of something on the inside. If there isn't an easy way to coerce this behavior, at the end of the day, plotly renders AN SVG. You can always manipulate that directly, or use CSS (e.g. make the circle big, then start slicing using CSS to make a nice pizza-slice shaped triangle that conveniently is mostly outside the bar). I've found plotly works quite well with the python data science ecosystem, but making complex interactive charts that render quickly in a web context using plotly was not fun for me. While components of the API are well documented, there's a lot of undocumented API behavior you can manipulate. On Thu, Mar 1, 2018 at 5:44 PM, Eric Floehr wrote: > All, > > I'm trying to determine which python graphing library would be able to > make the following graph type. I don't have a name for it, but here is the > description... > > It's basically a vertical or horizontal line on some scale, with shaded > rectangles over parts of it indicating certain things, and a triangle with > a specific number pointing to that spot on the line. > > The closest example is the original Star Trek sick bay charts, and I found > an example here: > > https://blogs.sas.com/content/sastraining/files/2017/06/ > startrek_med_dashboard_tips.gif > > Any thoughts? > > Thanks so much! > Eric > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrehner at e-wrench.net Thu Mar 1 22:45:46 2018 From: mrehner at e-wrench.net (mrehner) Date: Fri, 2 Mar 2018 03:45:46 +0000 Subject: [CentralOH] Python Graph Help In-Reply-To: References: Message-ID: <0F9E1D0DC01BC4489DC8D649BF9F27F5F62CAD4F@EXMBX01.prov.ad.hostmanagement.net> Eric, Can't really help on the implementation level. It looks like what you have is a 'box plot' or a 'facet grid'. You can add the triangle with an 'annotation', probably as a subplot. Seaborn has al built in function 'factorplot' that supposedly simplifies making these kind of plots. Unfortunately I don't have any experience in making these kind of plots, only a book in which I'm trying to learn about data analytics. All I have may be some techincal terms that may or may not help your search. Cheers, Mike From: CentralOH [mailto:centraloh-bounces+mrehner=e-wrench.net at python.org] On Behalf Of Eric Floehr Sent: Thursday, March 1, 2018 5:45 PM To: Central Ohio Python Users Group Subject: [CentralOH] Python Graph Help All, I'm trying to determine which python graphing library would be able to make the following graph type. I don't have a name for it, but here is the description... It's basically a vertical or horizontal line on some scale, with shaded rectangles over parts of it indicating certain things, and a triangle with a specific number pointing to that spot on the line. The closest example is the original Star Trek sick bay charts, and I found an example here: https://blogs.sas.com/content/sastraining/files/2017/06/startrek_med_dashboard_tips.gif Any thoughts? Thanks so much! Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From winningham at gmail.com Fri Mar 2 01:46:09 2018 From: winningham at gmail.com (Thomas Winningham) Date: Fri, 2 Mar 2018 01:46:09 -0500 Subject: [CentralOH] Python Graph Help In-Reply-To: <0F9E1D0DC01BC4489DC8D649BF9F27F5F62CAD4F@EXMBX01.prov.ad.hostmanagement.net> References: <0F9E1D0DC01BC4489DC8D649BF9F27F5F62CAD4F@EXMBX01.prov.ad.hostmanagement.net> Message-ID: I have some thoughts just finishing a charting task at work with D3 after munging a lot of data with Python and making .json files to drive it. I think you're going to have to bite the bullet and do this from scratch unless you can find some kind of other packaged visualization that is to your liking that isn't quite exactly this from some high level charting program out there like Bokeh, matplotlib, etc. You're going to be in the world of drawing rectangles, polygons, and cursing the world of typesetting. I'd specifically watch out for something like Plotly as they are sort of unethical in my opinion by making their open source products tie in heavily with their online product offerings. The latest notebook style thing from the D3 people is sort of in this SaaS lock-in realm too, IMHO. --- 1. What is your target? Print? Web? Static or Animated? For print I'd recommend things like tikz or R's ggplot ... and I'd also recommend a format like postscript / pdf or svg. Of course animations are out unless you're making a flip book, or rasterizing your SVGs or something into JPGs and then encoding with ffmpeg. For web, I'd recommend D3. It has a nifty data binding concept that is slick if not exactly well thought out from a traditional JS developer viewpoint, and a whole lot of neat things that make interpolation and such easier. For video, I'd recommend any of the above or even things like Processing, GL Shaders, Blender, moviepy, or a game framework, or a compositing tool. --- 2. Planning Looking at the sample graph there's a lot of things that I'm sure you can find in Python a way to come up with: - Triangle shape and location - Main bar location - Dividing the bar up into red / green areas - Scale - Tick marks - Labeling of axis - Text placement Text is probably the hardest. HTML has a lot of nice wrapping, justification, etc and SVG does not (natively) and neither do a lot of other things. LaTeX is of course the "best" if you have postscript / pdf in the mix and what really nifty things like automatic typographic ligatures like where like the TH pairs are done as a single glyph. Or math formula rendering, although MathJax will do that on the web for ya. --- 3. Transforms Things like Processing like to drive home the idea of transforms. In short, you begin in space at 0,0 for 2D or 0,0,0 for 3D ... some start at bottom left, some at top left. You have your area like width x height x depth, plus perhaps some concept of resolution in a raster context. For print 600 or 1200 or whatever is nice DPI but screen is usually 90, but in the mobile world these days it is all LPS and here be dragons. If you always do everything from 0,0 or center things around 0,0 then you can "transform" the whole block of stuff to whatever location in arbitrary groups. For SVG this is the "g" object... in Processing these are the "pushMatrix" and "translate". In 3d, 0,0,0 is "world center" usually, and in print and computer screen, 0,0 is again like top left usually, although I think Inkscape is bottom left. --- 4. Interpolation You could manually place everything in X,Y coordinates but let's take the tick marks for instance... you really are creating interpolation functions for all of these things so the Y of the tick marks is something like in python like range(0,100,10) for a tick mark every 10 steps. You may consider the "width" and "height" as constants and always be doing things in relation to those such as center being width/2 and height/2 or the rule of thirds /3 ... Of course all of those things can be thought of in an object oriented way if each thing is only concerned about its local 0,0 when doing stuff specifically to its function's task, and then you can assemble all those functions by translating them to their relative locations within the greater document canvas. --- 5. Python tips I've used PySVG... I also looked at "svgwrite" just now and it seems pretty good. For rather I've done a lot with pycairo ... SVG is just XML so you could also just sort of string concatenate your way to success. Another thought would be to mock up what you want with Inkscape, and use its "simple svg" output format to create a template you can then manipulate with ElementTree. For D3 everything works better IMHO with a nice JSON object to throw at it. Doing a lot of calculation of coordinates in Python of various data points where you're more comfortable, and then hacking up some basic examples of the drawing features of D3 was a template I used with this last project. ....... So, best of luck, that's about it for some random ramblings on the subject. In short, If this is for a website and animated, maybe using PyCairo stills into FFMPEG to make GIFs or use D3 and use SVG and JavaScript. In just for the website and static, use PySVG, svgwrite, or pycairo. If you can find something that will get the point across, it will save a lot of time "drawing" everything to just throw your data at a packaged visualization tool. Best of luck, Thomas On Thu, Mar 1, 2018 at 10:45 PM, mrehner wrote: > Eric, > > > > Can't really help on the implementation level. It looks like what you have > is a 'box plot' or a 'facet grid'. You can add the triangle with an > 'annotation', probably as a subplot. Seaborn has al built in function > 'factorplot' that supposedly simplifies making these kind of plots. > Unfortunately I don't have any experience in making these kind of plots, > only a book in which I'm trying to learn about data analytics. All I have > may be some techincal terms that may or may not help your search. > > > > Cheers, > > > > Mike > > > > *From:* CentralOH [mailto:centraloh-bounces+mrehner=e-wrench.net at python. > org] *On Behalf Of *Eric Floehr > *Sent:* Thursday, March 1, 2018 5:45 PM > *To:* Central Ohio Python Users Group > *Subject:* [CentralOH] Python Graph Help > > > > All, > > > > I'm trying to determine which python graphing library would be able to > make the following graph type. I don't have a name for it, but here is the > description... > > > > It's basically a vertical or horizontal line on some scale, with shaded > rectangles over parts of it indicating certain things, and a triangle with > a specific number pointing to that spot on the line. > > > > The closest example is the original Star Trek sick bay charts, and I found > an example here: > > > > https://blogs.sas.com/content/sastraining/files/2017/06/ > startrek_med_dashboard_tips.gif > > > > Any thoughts? > > > Thanks so much! > > Eric > > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From winningham at gmail.com Fri Mar 2 01:50:01 2018 From: winningham at gmail.com (Thomas Winningham) Date: Fri, 2 Mar 2018 01:50:01 -0500 Subject: [CentralOH] Python Graph Help In-Reply-To: References: <0F9E1D0DC01BC4489DC8D649BF9F27F5F62CAD4F@EXMBX01.prov.ad.hostmanagement.net> Message-ID: Sorry just noticed I said LPS when I meant LPI or PPI ... https://forums.adobe.com/thread/370714 or https://en.wikipedia.org/wiki/Pixel_density or https://en.wikipedia.org/wiki/Retina_Display On Fri, Mar 2, 2018 at 1:46 AM, Thomas Winningham wrote: > I have some thoughts just finishing a charting task at work with D3 after > munging a lot of data with Python and making .json files to drive it. > > I think you're going to have to bite the bullet and do this from scratch > unless you can find some kind of other packaged visualization that is to > your liking that isn't quite exactly this from some high level charting > program out there like Bokeh, matplotlib, etc. You're going to be in the > world of drawing rectangles, polygons, and cursing the world of > typesetting. I'd specifically watch out for something like Plotly as they > are sort of unethical in my opinion by making their open source products > tie in heavily with their online product offerings. The latest notebook > style thing from the D3 people is sort of in this SaaS lock-in realm too, > IMHO. > > --- 1. What is your target? Print? Web? Static or Animated? > > For print I'd recommend things like tikz or R's ggplot ... and I'd also > recommend a format like postscript / pdf or svg. Of course animations are > out unless you're making a flip book, or rasterizing your SVGs or something > into JPGs and then encoding with ffmpeg. > > For web, I'd recommend D3. It has a nifty data binding concept that is > slick if not exactly well thought out from a traditional JS developer > viewpoint, and a whole lot of neat things that make interpolation and such > easier. > > For video, I'd recommend any of the above or even things like Processing, > GL Shaders, Blender, moviepy, or a game framework, or a compositing tool. > > --- 2. Planning > > Looking at the sample graph there's a lot of things that I'm sure you can > find in Python a way to come up with: > - Triangle shape and location > - Main bar location > - Dividing the bar up into red / green areas > - Scale > - Tick marks > - Labeling of axis > - Text placement > > Text is probably the hardest. HTML has a lot of nice wrapping, > justification, etc and SVG does not (natively) and neither do a lot of > other things. LaTeX is of course the "best" if you have postscript / pdf in > the mix and what really nifty things like automatic typographic ligatures > like where like the TH pairs are done as a single glyph. Or math formula > rendering, although MathJax will do that on the web for ya. > > --- 3. Transforms > > Things like Processing like to drive home the idea of transforms. In > short, you begin in space at 0,0 for 2D or 0,0,0 for 3D ... some start at > bottom left, some at top left. You have your area like width x height x > depth, plus perhaps some concept of resolution in a raster context. For > print 600 or 1200 or whatever is nice DPI but screen is usually 90, but in > the mobile world these days it is all LPS and here be dragons. > > If you always do everything from 0,0 or center things around 0,0 then you > can "transform" the whole block of stuff to whatever location in arbitrary > groups. For SVG this is the "g" object... in Processing these are the > "pushMatrix" and "translate". > > In 3d, 0,0,0 is "world center" usually, and in print and computer screen, > 0,0 is again like top left usually, although I think Inkscape is bottom > left. > > --- 4. Interpolation > > You could manually place everything in X,Y coordinates but let's take the > tick marks for instance... you really are creating interpolation functions > for all of these things so the Y of the tick marks is something like in > python like range(0,100,10) for a tick mark every 10 steps. > > You may consider the "width" and "height" as constants and always be doing > things in relation to those such as center being width/2 and height/2 or > the rule of thirds /3 ... > > Of course all of those things can be thought of in an object oriented way > if each thing is only concerned about its local 0,0 when doing stuff > specifically to its function's task, and then you can assemble all those > functions by translating them to their relative locations within the > greater document canvas. > > --- 5. Python tips > > I've used PySVG... I also looked at "svgwrite" just now and it seems > pretty good. For rather I've done a lot with pycairo ... > > SVG is just XML so you could also just sort of string concatenate your way > to success. > > Another thought would be to mock up what you want with Inkscape, and use > its "simple svg" output format to create a template you can then manipulate > with ElementTree. > > For D3 everything works better IMHO with a nice JSON object to throw at > it. Doing a lot of calculation of coordinates in Python of various data > points where you're more comfortable, and then hacking up some basic > examples of the drawing features of D3 was a template I used with this last > project. > > ....... > > So, best of luck, that's about it for some random ramblings on the > subject. In short, If this is for a website and animated, maybe using > PyCairo stills into FFMPEG to make GIFs or use D3 and use SVG and > JavaScript. In just for the website and static, use PySVG, svgwrite, or > pycairo. > > If you can find something that will get the point across, it will save a > lot of time "drawing" everything to just throw your data at a packaged > visualization tool. > > Best of luck, > > Thomas > > > > > > > > > > > > > > > > > > > > > > > On Thu, Mar 1, 2018 at 10:45 PM, mrehner wrote: > >> Eric, >> >> >> >> Can't really help on the implementation level. It looks like what you >> have is a 'box plot' or a 'facet grid'. You can add the triangle with an >> 'annotation', probably as a subplot. Seaborn has al built in function >> 'factorplot' that supposedly simplifies making these kind of plots. >> Unfortunately I don't have any experience in making these kind of plots, >> only a book in which I'm trying to learn about data analytics. All I have >> may be some techincal terms that may or may not help your search. >> >> >> >> Cheers, >> >> >> >> Mike >> >> >> >> *From:* CentralOH [mailto:centraloh-bounces+mrehner= >> e-wrench.net at python.org] *On Behalf Of *Eric Floehr >> *Sent:* Thursday, March 1, 2018 5:45 PM >> *To:* Central Ohio Python Users Group >> *Subject:* [CentralOH] Python Graph Help >> >> >> >> All, >> >> >> >> I'm trying to determine which python graphing library would be able to >> make the following graph type. I don't have a name for it, but here is the >> description... >> >> >> >> It's basically a vertical or horizontal line on some scale, with shaded >> rectangles over parts of it indicating certain things, and a triangle with >> a specific number pointing to that spot on the line. >> >> >> >> The closest example is the original Star Trek sick bay charts, and I >> found an example here: >> >> >> >> https://blogs.sas.com/content/sastraining/files/2017/06/star >> trek_med_dashboard_tips.gif >> >> >> >> Any thoughts? >> >> >> Thanks so much! >> >> Eric >> >> >> >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> https://mail.python.org/mailman/listinfo/centraloh >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrehner at e-wrench.net Fri Mar 2 11:22:24 2018 From: mrehner at e-wrench.net (mrehner) Date: Fri, 2 Mar 2018 16:22:24 +0000 Subject: [CentralOH] Python Graph Help In-Reply-To: References: Message-ID: <0F9E1D0DC01BC4489DC8D649BF9F27F5F62CB30F@EXMBX01.prov.ad.hostmanagement.net> https://datavizcatalogue.com/ Cheers, Mike From: CentralOH [mailto:centraloh-bounces+mrehner=e-wrench.net at python.org] On Behalf Of Eric Floehr Sent: Thursday, March 1, 2018 5:45 PM To: Central Ohio Python Users Group Subject: [CentralOH] Python Graph Help All, I'm trying to determine which python graphing library would be able to make the following graph type. I don't have a name for it, but here is the description... It's basically a vertical or horizontal line on some scale, with shaded rectangles over parts of it indicating certain things, and a triangle with a specific number pointing to that spot on the line. The closest example is the original Star Trek sick bay charts, and I found an example here: https://blogs.sas.com/content/sastraining/files/2017/06/startrek_med_dashboard_tips.gif Any thoughts? Thanks so much! Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From shareef at dabdoub.net Fri Mar 2 16:05:13 2018 From: shareef at dabdoub.net (Shareef Dabdoub) Date: Fri, 2 Mar 2018 16:05:13 -0500 Subject: [CentralOH] Python Graph Help In-Reply-To: <0F9E1D0DC01BC4489DC8D649BF9F27F5F62CB30F@EXMBX01.prov.ad.hostmanagement.net> References: <0F9E1D0DC01BC4489DC8D649BF9F27F5F62CB30F@EXMBX01.prov.ad.hostmanagement.net> Message-ID: I put this together with matplotlib. It's exactly what you described, although placement of things is a bit fiddly. But you could wrap this in some sort of class or function to parameterize it. --------------- from matplotlib import pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax.set_frame_on(False) ax.xaxis.set_visible(False) ax.set_ylim((93,104)) ax.set_yticks(range(93,104,2), minor=True) ax.axvline(linewidth=20, color="r", ymin=0, ymax=0.5) ax.axvline(linewidth=20, color="orange", ymin=0.5, ymax=0.675) ax.axvline(linewidth=20, color="r", ymin=0.675, ymax=1) t1 = plt.Polygon([(0.03,99), (0.15,100), (0.15,98)], color="g") plt.gca().add_patch(t1) ax.text(0.06, 98.8, "99$^o$F", fontsize=12, color="w") plt.show() -------- On Fri, Mar 2, 2018 at 11:22 AM, mrehner wrote: > https://datavizcatalogue.com/ > > > > Cheers, > > > > Mike > > > > *From:* CentralOH [mailto:centraloh-bounces+mrehner=e-wrench.net at python. > org] *On Behalf Of *Eric Floehr > *Sent:* Thursday, March 1, 2018 5:45 PM > *To:* Central Ohio Python Users Group > *Subject:* [CentralOH] Python Graph Help > > > > All, > > > > I'm trying to determine which python graphing library would be able to > make the following graph type. I don't have a name for it, but here is the > description... > > > > It's basically a vertical or horizontal line on some scale, with shaded > rectangles over parts of it indicating certain things, and a triangle with > a specific number pointing to that spot on the line. > > > > The closest example is the original Star Trek sick bay charts, and I found > an example here: > > > > https://blogs.sas.com/content/sastraining/files/2017/06/ > startrek_med_dashboard_tips.gif > > > > Any thoughts? > > > Thanks so much! > > Eric > > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shareef at dabdoub.net Fri Mar 2 16:06:58 2018 From: shareef at dabdoub.net (Shareef Dabdoub) Date: Fri, 2 Mar 2018 16:06:58 -0500 Subject: [CentralOH] Python Graph Help In-Reply-To: References: <0F9E1D0DC01BC4489DC8D649BF9F27F5F62CB30F@EXMBX01.prov.ad.hostmanagement.net> Message-ID: I don't think the example figure came through, so: ? On Fri, Mar 2, 2018 at 4:05 PM, Shareef Dabdoub wrote: > I put this together with matplotlib. It's exactly what you described, > although placement of things is a bit fiddly. But you could wrap this in > some sort of class or function to parameterize it. > > --------------- > from matplotlib import pyplot as plt > > fig = plt.figure() > ax = fig.add_subplot(111) > > ax.set_frame_on(False) > ax.xaxis.set_visible(False) > ax.set_ylim((93,104)) > ax.set_yticks(range(93,104,2), minor=True) > > ax.axvline(linewidth=20, color="r", ymin=0, ymax=0.5) > ax.axvline(linewidth=20, color="orange", ymin=0.5, ymax=0.675) > ax.axvline(linewidth=20, color="r", ymin=0.675, ymax=1) > > t1 = plt.Polygon([(0.03,99), (0.15,100), (0.15,98)], color="g") > plt.gca().add_patch(t1) > ax.text(0.06, 98.8, "99$^o$F", fontsize=12, color="w") > > plt.show() > -------- > > > > > On Fri, Mar 2, 2018 at 11:22 AM, mrehner wrote: > >> https://datavizcatalogue.com/ >> >> >> >> Cheers, >> >> >> >> Mike >> >> >> >> *From:* CentralOH [mailto:centraloh-bounces+mrehner= >> e-wrench.net at python.org] *On Behalf Of *Eric Floehr >> *Sent:* Thursday, March 1, 2018 5:45 PM >> *To:* Central Ohio Python Users Group >> *Subject:* [CentralOH] Python Graph Help >> >> >> >> All, >> >> >> >> I'm trying to determine which python graphing library would be able to >> make the following graph type. I don't have a name for it, but here is the >> description... >> >> >> >> It's basically a vertical or horizontal line on some scale, with shaded >> rectangles over parts of it indicating certain things, and a triangle with >> a specific number pointing to that spot on the line. >> >> >> >> The closest example is the original Star Trek sick bay charts, and I >> found an example here: >> >> >> >> https://blogs.sas.com/content/sastraining/files/2017/06/star >> trek_med_dashboard_tips.gif >> >> >> >> Any thoughts? >> >> >> Thanks so much! >> >> Eric >> >> >> >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> https://mail.python.org/mailman/listinfo/centraloh >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: example.png Type: image/png Size: 5153 bytes Desc: not available URL: From pybokeh at gmail.com Fri Mar 2 16:32:39 2018 From: pybokeh at gmail.com (pybokeh) Date: Fri, 2 Mar 2018 16:32:39 -0500 Subject: [CentralOH] Python Graph Help In-Reply-To: References: <0F9E1D0DC01BC4489DC8D649BF9F27F5F62CB30F@EXMBX01.prov.ad.hostmanagement.net> Message-ID: OMG, a sensible response. Thanks Shareef! On Fri, Mar 2, 2018 at 4:06 PM, Shareef Dabdoub wrote: > I don't think the example figure came through, so: > > > ? > > On Fri, Mar 2, 2018 at 4:05 PM, Shareef Dabdoub > wrote: > >> I put this together with matplotlib. It's exactly what you described, >> although placement of things is a bit fiddly. But you could wrap this in >> some sort of class or function to parameterize it. >> >> --------------- >> from matplotlib import pyplot as plt >> >> fig = plt.figure() >> ax = fig.add_subplot(111) >> >> ax.set_frame_on(False) >> ax.xaxis.set_visible(False) >> ax.set_ylim((93,104)) >> ax.set_yticks(range(93,104,2), minor=True) >> >> ax.axvline(linewidth=20, color="r", ymin=0, ymax=0.5) >> ax.axvline(linewidth=20, color="orange", ymin=0.5, ymax=0.675) >> ax.axvline(linewidth=20, color="r", ymin=0.675, ymax=1) >> >> t1 = plt.Polygon([(0.03,99), (0.15,100), (0.15,98)], color="g") >> plt.gca().add_patch(t1) >> ax.text(0.06, 98.8, "99$^o$F", fontsize=12, color="w") >> >> plt.show() >> -------- >> >> >> >> >> On Fri, Mar 2, 2018 at 11:22 AM, mrehner wrote: >> >>> https://datavizcatalogue.com/ >>> >>> >>> >>> Cheers, >>> >>> >>> >>> Mike >>> >>> >>> >>> *From:* CentralOH [mailto:centraloh-bounces+mrehner= >>> e-wrench.net at python.org] *On Behalf Of *Eric Floehr >>> *Sent:* Thursday, March 1, 2018 5:45 PM >>> *To:* Central Ohio Python Users Group >>> *Subject:* [CentralOH] Python Graph Help >>> >>> >>> >>> All, >>> >>> >>> >>> I'm trying to determine which python graphing library would be able to >>> make the following graph type. I don't have a name for it, but here is the >>> description... >>> >>> >>> >>> It's basically a vertical or horizontal line on some scale, with shaded >>> rectangles over parts of it indicating certain things, and a triangle with >>> a specific number pointing to that spot on the line. >>> >>> >>> >>> The closest example is the original Star Trek sick bay charts, and I >>> found an example here: >>> >>> >>> >>> https://blogs.sas.com/content/sastraining/files/2017/06/star >>> trek_med_dashboard_tips.gif >>> >>> >>> >>> Any thoughts? >>> >>> >>> Thanks so much! >>> >>> Eric >>> >>> >>> >>> _______________________________________________ >>> CentralOH mailing list >>> CentralOH at python.org >>> https://mail.python.org/mailman/listinfo/centraloh >>> >>> >> > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: example.png Type: image/png Size: 5153 bytes Desc: not available URL: From eric at intellovations.com Tue Mar 6 12:01:10 2018 From: eric at intellovations.com (Eric Floehr) Date: Tue, 6 Mar 2018 12:01:10 -0500 Subject: [CentralOH] Python Graph Help In-Reply-To: References: <0F9E1D0DC01BC4489DC8D649BF9F27F5F62CB30F@EXMBX01.prov.ad.hostmanagement.net> Message-ID: Thanks Shareef! That is perfect! On Fri, Mar 2, 2018 at 4:06 PM, Shareef Dabdoub wrote: > I don't think the example figure came through, so: > > > ? > > On Fri, Mar 2, 2018 at 4:05 PM, Shareef Dabdoub > wrote: > >> I put this together with matplotlib. It's exactly what you described, >> although placement of things is a bit fiddly. But you could wrap this in >> some sort of class or function to parameterize it. >> >> --------------- >> from matplotlib import pyplot as plt >> >> fig = plt.figure() >> ax = fig.add_subplot(111) >> >> ax.set_frame_on(False) >> ax.xaxis.set_visible(False) >> ax.set_ylim((93,104)) >> ax.set_yticks(range(93,104,2), minor=True) >> >> ax.axvline(linewidth=20, color="r", ymin=0, ymax=0.5) >> ax.axvline(linewidth=20, color="orange", ymin=0.5, ymax=0.675) >> ax.axvline(linewidth=20, color="r", ymin=0.675, ymax=1) >> >> t1 = plt.Polygon([(0.03,99), (0.15,100), (0.15,98)], color="g") >> plt.gca().add_patch(t1) >> ax.text(0.06, 98.8, "99$^o$F", fontsize=12, color="w") >> >> plt.show() >> -------- >> >> >> >> >> On Fri, Mar 2, 2018 at 11:22 AM, mrehner wrote: >> >>> https://datavizcatalogue.com/ >>> >>> >>> >>> Cheers, >>> >>> >>> >>> Mike >>> >>> >>> >>> *From:* CentralOH [mailto:centraloh-bounces+mrehner= >>> e-wrench.net at python.org] *On Behalf Of *Eric Floehr >>> *Sent:* Thursday, March 1, 2018 5:45 PM >>> *To:* Central Ohio Python Users Group >>> *Subject:* [CentralOH] Python Graph Help >>> >>> >>> >>> All, >>> >>> >>> >>> I'm trying to determine which python graphing library would be able to >>> make the following graph type. I don't have a name for it, but here is the >>> description... >>> >>> >>> >>> It's basically a vertical or horizontal line on some scale, with shaded >>> rectangles over parts of it indicating certain things, and a triangle with >>> a specific number pointing to that spot on the line. >>> >>> >>> >>> The closest example is the original Star Trek sick bay charts, and I >>> found an example here: >>> >>> >>> >>> https://blogs.sas.com/content/sastraining/files/2017/06/star >>> trek_med_dashboard_tips.gif >>> >>> >>> >>> Any thoughts? >>> >>> >>> Thanks so much! >>> >>> Eric >>> >>> >>> >>> _______________________________________________ >>> CentralOH mailing list >>> CentralOH at python.org >>> https://mail.python.org/mailman/listinfo/centraloh >>> >>> >> > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: example.png Type: image/png Size: 5153 bytes Desc: not available URL: From eric at intellovations.com Tue Mar 6 12:01:47 2018 From: eric at intellovations.com (Eric Floehr) Date: Tue, 6 Mar 2018 12:01:47 -0500 Subject: [CentralOH] Popen file descriptor difference between Python 2.6 and 2.7+ on Linux In-Reply-To: References: <20180216233241.158f64c222273d749fe75ec7@columbus.rr.com> Message-ID: That's a great idea, Joe, thanks! On Mon, Feb 19, 2018 at 5:54 PM, Joe Shaw wrote: > Hi, > > If you have access to the shell, bash can do a nice job of this > concurrently: > > diff -u <(gunzip -c file1.gz) <(gunzip -c file2.gz) > > Under the covers it?s doing the /proc/fd trick, and it saves you from > having to use a temporary file or reimplementing it yourself in Python. > > Joe > > On Mon, Feb 19, 2018 at 3:55 PM Eric Floehr > wrote: > >> Good ideas... the actual application is gunzipping two ASCII files >> (gzipp'ed for disk space consideration) and diff'ing them. >> >> These files are added to but not just appended to, so we need to find the >> changes between two files. We do that, rather than processing the whole >> file each time because these are large files with lots of row and parsing >> and determining if a row's data exists or has changed would be hugely >> expensive. And the system diff program is the best for that. >> >> >> >> >> >> On Sat, Feb 17, 2018 at 6:42 PM, Thomas Winningham >> wrote: >> >>> Well, sucks you had to go through this rewrite. I think it shows that >>> all code has a certain level of implicit functionality whose interpretation >>> varies between stakeholders over time. So while it took a little digging, I >>> think it also shows that everything is eventually knowable if needed. >>> >>> "Explicit is better than implicit" although the original code seemed >>> rather explicit its own right, this new code is certainly more explicit. If >>> IO performance becomes an issue with the tempfile, maybe named pipes could >>> be used? I learned a lot about per-process file descriptors though, and >>> reinforces how recently I learned that *nix opens a file based on >>> descriptor and not by name whereas like you say Windows can only have a >>> file opened by one process at a time because the file name is the >>> descriptor in a sense. >>> >>> There's always a way to further over engineer this probably too, I'm >>> thinking with sockets or even a message queue :P >>> >>> >>> On Sat, Feb 17, 2018 at 11:20 AM, Eric Floehr >>> wrote: >>> >>>> Thank you Neil and Thomas, here is a summary of what you discovered: >>>> >>>> There is a regression in Python 2.7 where file descriptors are not >>>> passed to child processes in the subprocess module, whereas in Python 2.6 >>>> they were. >>>> >>>> In order to address this, they added a "pass_fds" parameter to Popen in >>>> Python 3.2. However Python 2.7 does not have this parameter. >>>> >>>> So, in order for this to work on Python 2.7, I resorted to using named >>>> temporary files. This code won't work on Windows NT and higher (per Python >>>> documentation, because named temporary files can't be opened more than once >>>> on Windows NT and higher but can on UNIX-like systems). >>>> >>>> Here is the summary of changes: >>>> >>>> 1. Wrote contents of first Popen's stdout to a NamedTemporaryFile >>>> 2. Passed the name of the NamedTemporaryFile to the second Popen >>>> 3. Added with blocks to ensure both Popen's get closed properly >>>> 4. Closed the NamedTemporaryFile after the second Popen finished, to >>>> delete the temp file off disk. >>>> >>>> Here is the code: >>>> >>>> -------------------------------------------------- >>>> from subprocess import Popen, PIPE >>>> import tempfile >>>> >>>> with Popen( >>>> ["cat"], >>>> stdin=open('/tmp/test', 'rb'), >>>> stdout=PIPE, >>>> universal_newlines=True).stdout as data: >>>> tmpfile = tempfile.NamedTemporaryFile() >>>> tmpfile.write(data.read()) >>>> tmpfile.flush() >>>> >>>> with Popen( >>>> ["cat", >>>> tmpfile.name], >>>> stdout=PIPE, >>>> universal_newlines=True,).stdout as fddata: >>>> print(fddata.read()) >>>> >>>> tmpfile.close() >>>> -------------------------------------------------- >>>> >>>> >>>> This works on 2.6, 2.7, and 3.5. Thanks again for all of your help! >>>> Eric >>>> >>>> >>>> >>>> On Sat, Feb 17, 2018 at 12:39 AM, Thomas Winningham < >>>> winningham at gmail.com> wrote: >>>> >>>>> oh and the shell=False and stderr = PIPE are not needed that was me >>>>> just trying to fudge things somehow and left those in there in that code... >>>>> really the pass_fds flag is the thing >>>>> >>>>> On Sat, Feb 17, 2018 at 12:38 AM, Thomas Winningham < >>>>> winningham at gmail.com> wrote: >>>>> >>>>>> I was replying on Twitter, but I suspect the behavior slowly became >>>>>> undefined somewhere between 2.7 and 3 ... but after 3.2 i can do this and >>>>>> it works: >>>>>> ------------------------ >>>>>> from subprocess import Popen, PIPE >>>>>> >>>>>> data = Popen( >>>>>> ["cat"], >>>>>> stdin=open('/tmp/test', 'rb'), >>>>>> stdout=PIPE, >>>>>> stderr=PIPE, >>>>>> universal_newlines=True, >>>>>> shell=False).stdout >>>>>> >>>>>> fd_name = '/dev/fd/%d' % data.fileno() >>>>>> >>>>>> fddata = Popen( >>>>>> ["cat",fd_name], >>>>>> stdout=PIPE, >>>>>> universal_newlines=True, >>>>>> pass_fds=(data.fileno(),)).stdout >>>>>> >>>>>> print(fddata.read()) >>>>>> ------------------------ >>>>>> the "pass_fds" option was added in 3.2 per the subprocess >>>>>> documentation >>>>>> >>>>>> >>>>>> On Fri, Feb 16, 2018 at 11:32 PM, Neil Ludban < >>>>>> nludban at columbus.rr.com> wrote: >>>>>> >>>>>>> On Fri, 16 Feb 2018 22:34:35 -0500 >>>>>>> Eric Floehr wrote: >>>>>>> > I have a really odd problem. I have some code that requires a >>>>>>> Linux file >>>>>>> > descriptor (/dev/fd/N) where N is some number. The following >>>>>>> example code >>>>>>> > demonstrates effectively what is being done. >>>>>>> > >>>>>>> > In order to run the code create a file called "/tmp/test" with >>>>>>> some text in >>>>>>> > it. >>>>>>> > >>>>>>> > The code works in Python 2.6, but in Python 2.7 or later, I get: >>>>>>> > >>>>>>> > cat: /dev/fd/4: No such file or directory >>>>>>> >>>>>>> Smells like a back-porting of adding the O_CLOEXEC flag... >>>>>>> >>>>>>> Unless O_CLOEXEC flag was specified, the new descriptor is set >>>>>>> to remain >>>>>>> open across execve(2) system calls; see close(2), fcntl(2) and >>>>>>> O_CLOEXEC >>>>>>> description. >>>>>>> >>>>>>> https://www.python.org/dev/peps/pep-0446/ >>>>>>> _______________________________________________ >>>>>>> CentralOH mailing list >>>>>>> CentralOH at python.org >>>>>>> https://mail.python.org/mailman/listinfo/centraloh >>>>>>> >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> CentralOH mailing list >>>>> CentralOH at python.org >>>>> https://mail.python.org/mailman/listinfo/centraloh >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> CentralOH mailing list >>>> CentralOH at python.org >>>> https://mail.python.org/mailman/listinfo/centraloh >>>> >>>> >>> >>> _______________________________________________ >>> CentralOH mailing list >>> CentralOH at python.org >>> https://mail.python.org/mailman/listinfo/centraloh >>> >>> >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> https://mail.python.org/mailman/listinfo/centraloh >> > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From y2k at y2kbugger.com Tue Mar 6 16:21:46 2018 From: y2k at y2kbugger.com (Zak Kohler) Date: Tue, 6 Mar 2018 16:21:46 -0500 Subject: [CentralOH] State of Python Deployment Message-ID: Does anyone you have any experience/opinion with using any of these, specifically in a corporate environment? I need to consider IIS as well as Windows 7/8/10 clients, with potentially multiple applications per client with conflicting deps. Are there any other options that I have missed? *Dependency Resolvers* Can be cross platform and correct packages can be pulled regardless of OS or bit-ness *pip + virtualenv* ? Would work well pure python deps ? QT and other binary deps could be issue *(mini)conda + conda env* ? handles binary deps as well ? how to pull package deps from an intranet store? *Freezers* Contains all binary and python deps wrapped up into a single archive. Finicky in my experience. Problems with UDF xlwings integration. *cxfreeze* *PyInstaller* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mihandler0 at gmail.com Tue Mar 6 16:44:07 2018 From: mihandler0 at gmail.com (Michael Handler) Date: Tue, 6 Mar 2018 16:44:07 -0500 Subject: [CentralOH] State of Python Deployment In-Reply-To: References: Message-ID: Another option is pipenv. Maybe. I DO NOT have experience using it in an enterprise environment, and I don't know about its operation on Windows. Here's a link to a useful article. On Tue, Mar 6, 2018 at 4:21 PM, Zak Kohler wrote: > Does anyone you have any experience/opinion with using any of these, > specifically in a corporate environment? > > > I need to consider IIS as well as Windows 7/8/10 clients, with potentially > multiple applications per client with conflicting deps. > > > Are there any other options that I have missed? > > > > *Dependency Resolvers* > > Can be cross platform and correct packages can be pulled regardless of OS > or bit-ness > > *pip + virtualenv* > > ? Would work well pure python deps > > ? QT and other binary deps could be issue > > *(mini)conda + conda env* > > ? handles binary deps as well > > ? how to pull package deps from an intranet store? > > > > *Freezers* > > Contains all binary and python deps wrapped up into a single archive. > Finicky in my experience. Problems with UDF xlwings integration. > > *cxfreeze* > > *PyInstaller* > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrehner at e-wrench.net Wed Mar 7 00:04:40 2018 From: mrehner at e-wrench.net (mrehner) Date: Wed, 7 Mar 2018 05:04:40 +0000 Subject: [CentralOH] Python Graph Help In-Reply-To: References: <0F9E1D0DC01BC4489DC8D649BF9F27F5F62CB30F@EXMBX01.prov.ad.hostmanagement.net> Message-ID: <0F9E1D0DC01BC4489DC8D649BF9F27F5F62CD1A4@EXMBX01.prov.ad.hostmanagement.net> Eric, Your question intrigued me and I worked on it some but now I have to put it aside. I also used maplotlib. For an html view of a jupyter notebook of a start on the Star Trek Medical Dasboard see http://www.babarehner.com/ewrench1011/Python/index.html and click on PyTrek Medical Dashboard on the left menu bar. If doing it for real I would probably use gridspec in mathplotlib Cheers, Mike From: CentralOH [mailto:centraloh-bounces+mrehner=e-wrench.net at python.org] On Behalf Of Eric Floehr Sent: Tuesday, March 6, 2018 12:01 PM To: Mailing list for Central Ohio Python User Group (COhPy) Subject: Re: [CentralOH] Python Graph Help Thanks Shareef! That is perfect! On Fri, Mar 2, 2018 at 4:06 PM, Shareef Dabdoub > wrote: I don't think the example figure came through, so: [cid:image001.png at 01D3B5A7.71EE60D0] ? On Fri, Mar 2, 2018 at 4:05 PM, Shareef Dabdoub > wrote: I put this together with matplotlib. It's exactly what you described, although placement of things is a bit fiddly. But you could wrap this in some sort of class or function to parameterize it. --------------- from matplotlib import pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax.set_frame_on(False) ax.xaxis.set_visible(False) ax.set_ylim((93,104)) ax.set_yticks(range(93,104,2), minor=True) ax.axvline(linewidth=20, color="r", ymin=0, ymax=0.5) ax.axvline(linewidth=20, color="orange", ymin=0.5, ymax=0.675) ax.axvline(linewidth=20, color="r", ymin=0.675, ymax=1) t1 = plt.Polygon([(0.03,99), (0.15,100), (0.15,98)], color="g") plt.gca().add_patch(t1) ax.text(0.06, 98.8, "99$^o$F", fontsize=12, color="w") plt.show() -------- On Fri, Mar 2, 2018 at 11:22 AM, mrehner > wrote: https://datavizcatalogue.com/ Cheers, Mike From: CentralOH [mailto:centraloh-bounces+mrehner=e-wrench.net at python.org] On Behalf Of Eric Floehr Sent: Thursday, March 1, 2018 5:45 PM To: Central Ohio Python Users Group Subject: [CentralOH] Python Graph Help All, I'm trying to determine which python graphing library would be able to make the following graph type. I don't have a name for it, but here is the description... It's basically a vertical or horizontal line on some scale, with shaded rectangles over parts of it indicating certain things, and a triangle with a specific number pointing to that spot on the line. The closest example is the original Star Trek sick bay charts, and I found an example here: https://blogs.sas.com/content/sastraining/files/2017/06/startrek_med_dashboard_tips.gif Any thoughts? Thanks so much! Eric _______________________________________________ CentralOH mailing list CentralOH at python.org https://mail.python.org/mailman/listinfo/centraloh _______________________________________________ CentralOH mailing list CentralOH at python.org https://mail.python.org/mailman/listinfo/centraloh -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 5153 bytes Desc: image001.png URL: From y2k at y2kbugger.com Thu Mar 8 13:19:46 2018 From: y2k at y2kbugger.com (Zak Kohler) Date: Thu, 8 Mar 2018 13:19:46 -0500 Subject: [CentralOH] State of Python Deployment In-Reply-To: References: Message-ID: Ahh I have been using pipenv at home and it is a wonderful substitute for virtualenvwrapper! I have had some success I think using a custom file:// conda channel. On Tue, Mar 6, 2018 at 4:44 PM, Michael Handler wrote: > Another option is pipenv. Maybe. > > I DO NOT have experience using it in an enterprise environment, and I don't > know about its operation on Windows. > > Here's a link to a useful article. > > On Tue, Mar 6, 2018 at 4:21 PM, Zak Kohler wrote: >> >> Does anyone you have any experience/opinion with using any of these, >> specifically in a corporate environment? >> >> >> I need to consider IIS as well as Windows 7/8/10 clients, with potentially >> multiple applications per client with conflicting deps. >> >> >> Are there any other options that I have missed? >> >> >> >> Dependency Resolvers >> >> Can be cross platform and correct packages can be pulled regardless of OS >> or bit-ness >> >> pip + virtualenv >> >> ? Would work well pure python deps >> >> ? QT and other binary deps could be issue >> >> (mini)conda + conda env >> >> ? handles binary deps as well >> >> ? how to pull package deps from an intranet store? >> >> >> >> Freezers >> >> Contains all binary and python deps wrapped up into a single archive. >> Finicky in my experience. Problems with UDF xlwings integration. >> >> cxfreeze >> >> PyInstaller >> >> >> >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> https://mail.python.org/mailman/listinfo/centraloh >> > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > From y2k at y2kbugger.com Fri Mar 9 08:52:50 2018 From: y2k at y2kbugger.com (Zak Kohler) Date: Fri, 9 Mar 2018 08:52:50 -0500 Subject: [CentralOH] State of Python Deployment Message-ID: I had forgot about this option: https://github.com/conda/constructor Does anyone have experience with conda constructor? From gjigsaw at gmail.com Fri Mar 9 12:42:17 2018 From: gjigsaw at gmail.com (Jason Green) Date: Fri, 9 Mar 2018 12:42:17 -0500 Subject: [CentralOH] State of Python Deployment In-Reply-To: References: Message-ID: I haven't touched virtual environments since I discovered docker in 2014. If stuck on Windows, check out Docker for Windows. If unable to get to Win10, check out Docker ToolBox or Vagrant. On Fri, Mar 9, 2018 at 8:52 AM, Zak Kohler wrote: > I had forgot about this option: > > https://github.com/conda/constructor > > Does anyone have experience with conda constructor? > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nludban at columbus.rr.com Fri Mar 9 13:33:33 2018 From: nludban at columbus.rr.com (Neil Ludban) Date: Fri, 9 Mar 2018 13:33:33 -0500 Subject: [CentralOH] python attrs library Message-ID: <20180309133333.83ecbb6f95fc2f5626606efd@columbus.rr.com> Ran across this library today, it has some very positive reviews. It could make a good presentation like last month's enum talk, if anyone wants to run with it... https://attrs.readthedocs.io/en/stable/#testimonials https://attrs.readthedocs.io/en/stable/overview.html --- 8< --- After declaring your attributes attrs gives you: * a concise and explicit overview of the class?s attributes, * a nice human-readable __repr__, * a complete set of comparison methods, * an initializer, * and much more, without writing dull boilerplate code again and again and without runtime performance penalties. --- 8< --- From eric at intellovations.com Sun Mar 11 12:37:56 2018 From: eric at intellovations.com (Eric Floehr) Date: Sun, 11 Mar 2018 12:37:56 -0400 Subject: [CentralOH] State of Python Deployment In-Reply-To: References: Message-ID: Jason, Docker seems like a great way to create completely reproducible environments. What is your workflow, and are there any tools that make managing Python environments "pipenv" (or mkvirtualenv/workon) easy? -Eric On Fri, Mar 9, 2018 at 12:42 PM, Jason Green wrote: > I haven't touched virtual environments since I discovered docker in 2014. > If stuck on Windows, check out Docker for Windows. If unable to get to > Win10, check out Docker ToolBox or Vagrant. > > > On Fri, Mar 9, 2018 at 8:52 AM, Zak Kohler wrote: > >> I had forgot about this option: >> >> https://github.com/conda/constructor >> >> Does anyone have experience with conda constructor? >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> https://mail.python.org/mailman/listinfo/centraloh >> > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erik.n.welch at gmail.com Sun Mar 11 13:26:21 2018 From: erik.n.welch at gmail.com (Erik Welch) Date: Sun, 11 Mar 2018 12:26:21 -0500 Subject: [CentralOH] State of Python Deployment In-Reply-To: References: Message-ID: conda constructor is used to build installers such as the Anaconda distribution, so this probably isn't what you're looking for. > > *(mini)conda + conda env*? handles binary deps as well > *? how to pull package deps from an intranet store?* I believe what you're looking for is https://conda.io/docs/user-guide/tasks/create-custom-channels.html . It is definitely possible to host conda packages internally and to do so on your own. Some organizations do this without the help of Anaconda (the company I work for). If you want an enterprise-ready solution and support, then your company can pay my company Anaconda (businesses cater to other businesses, and this is a pain point we have solved for many organizations). If you want to go it alone, though, the requisite tools and technologies are freely available. I'm sure I'm biased, but it sounds to me like your use case is exactly why conda was created. There has been lots of good advice on this thread, though, and Docker and pipenv are also good at what they do. Good luck! Erik On Sun, Mar 11, 2018 at 11:37 AM, Eric Floehr wrote: > Jason, > > Docker seems like a great way to create completely reproducible > environments. What is your workflow, and are there any tools that make > managing Python environments "pipenv" (or mkvirtualenv/workon) easy? > > -Eric > > > On Fri, Mar 9, 2018 at 12:42 PM, Jason Green wrote: > >> I haven't touched virtual environments since I discovered docker in 2014. >> If stuck on Windows, check out Docker for Windows. If unable to get to >> Win10, check out Docker ToolBox or Vagrant. >> >> >> On Fri, Mar 9, 2018 at 8:52 AM, Zak Kohler wrote: >> >>> I had forgot about this option: >>> >>> https://github.com/conda/constructor >>> >>> Does anyone have experience with conda constructor? >>> _______________________________________________ >>> CentralOH mailing list >>> CentralOH at python.org >>> https://mail.python.org/mailman/listinfo/centraloh >>> >> >> >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> https://mail.python.org/mailman/listinfo/centraloh >> >> > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric at intellovations.com Sun Mar 11 15:15:30 2018 From: eric at intellovations.com (Eric Floehr) Date: Sun, 11 Mar 2018 15:15:30 -0400 Subject: [CentralOH] March Monthly Meeting Message-ID: Our March meeting will be Monday, March 26, at 6pm at Forge by Pillar in the Smith Brothers Building. RSVP Here: https://www.meetup.com/Central-Ohio-Python-Users-Group/events/246491260/ This month, Harry Lindner will be talking about building a search engine in Python. Please help him out by suggesting a search topic here: https://goo.gl/forms/6vg3RxcC189SZx1K3 Sometimes you want something specific, but ctrl+f and Google are failing you. Have no fear, you can build your own search engine. We are going to build a search engine using flask (website), scrapy (web scraper) /pdfminer (pdf scraper), whoosh (text indexer / search), and Heroku (host). The code and demo will be posted online. The talk answers 3 questions: Why would you do this? How do you do this? What are the results? Then it?s open questions. We are taking suggestions for search topics. Please submit ideas here: https://goo.gl/forms/6vg3RxcC189SZx1K3 If there is time left, Travis Risner will continue talking about curio (an async library in Python) by example. Afterwards we'll be heading to Brazenhead on 5th. -------------- next part -------------- An HTML attachment was scrubbed... URL: From patrick.shuff at gmail.com Sun Mar 11 18:07:07 2018 From: patrick.shuff at gmail.com (Patrick Shuff) Date: Sun, 11 Mar 2018 15:07:07 -0700 Subject: [CentralOH] State of Python Deployment In-Reply-To: References: Message-ID: The way I would approach this is breaking down the problem into its individual components and making sure that whatever I choose always allows for a deterministic build/deployment process: 1. Choosing the right dependency management system to keep development environments to stay consistent and easy (e.g. virtualenv, pipenv, etc) 2. Choosing the right container imaging system to make sure your code and dependencies to production is _always_ deterministic (docker, rpm/deb, etc) 3. Choosing system for deploying your code to a server (google app engine, heroku, kubernetes, local docker instance, etc) To expand on my one of my workflows: 1. When doing local python development I generally use virtualenv (and virtualenvwrapper bash functions) to make it very easy for me to quickly spin up my development environment on any platform and pull in all the python dependencies without relying on any system libraries. This is important for consistency when you're developing to make sure system-wide packages that may differ across operating systems (linux, mac, windows, etc) don't impact development. This is especially important to do based on your "conflicting deps" comment. 2. Once I am done developing I need to "freeze" the external depencies my code relies on, package it up, and create an immutable file system (aka "image") of all code and dependencies . For this I simply freeze the state of external python packages and use docker to build it: pip freeze > requirements.txt docker build The docker build step is important to make sure that whenever I deploy my code + dependencies it is always deterministic. More specifically it means I should never have to rely on some outside pypi server to have a specific version of the dependencies my code relies on. This means my code should deploy out to my servers today, or in 3 years if I need to migrate to a new server and the library versions I was pinned to are long gone. Hopefully we all build our code more often than every 3 years but it is important that even if we had to we could without any worries. If a docker-like deployment style isn't what you're going for another alternative that I've used is using pex to create a python executable with all your dependencies. It would make deploying your software with an (rpm|deb|windows pkg mgr) much easier. 3. There are countless ways to deploy your code and what you choose may influence your decision for the container imaging system in #2. Spinning up local docker instances on a laptop or server running your favorite linux distro is extremely easy these days so it is a safe place to start. If your python webapp is something on your local network or your blog docker will be fine. If you need this to scale to many thousands of users and you want to using a cloud deployment system google app engine is a decent starting point. Sorry that my answers are not very windows focused as I don't have any relevant experience there. Hope this helps! Good luck! :) -- shuff On Sun, Mar 11, 2018 at 10:26 AM, Erik Welch wrote: > conda constructor is used to build installers such as the Anaconda > distribution, so this probably isn't what you're looking for. > > >> >> *(mini)conda + conda env*? handles binary deps as well >> *? how to pull package deps from an intranet store?* > > > I believe what you're looking for is https://conda.io/docs/user- > guide/tasks/create-custom-channels.html . It is definitely possible to > host conda packages internally and to do so on your own. Some > organizations do this without the help of Anaconda (the company I work > for). If you want an enterprise-ready solution and support, then your > company can pay my company Anaconda (businesses cater to other businesses, > and this is a pain point we have solved for many organizations). If you > want to go it alone, though, the requisite tools and technologies are > freely available. > > I'm sure I'm biased, but it sounds to me like your use case is exactly why > conda was created. There has been lots of good advice on this thread, > though, and Docker and pipenv are also good at what they do. > > Good luck! > Erik > > On Sun, Mar 11, 2018 at 11:37 AM, Eric Floehr > wrote: > >> Jason, >> >> Docker seems like a great way to create completely reproducible >> environments. What is your workflow, and are there any tools that make >> managing Python environments "pipenv" (or mkvirtualenv/workon) easy? >> >> -Eric >> >> >> On Fri, Mar 9, 2018 at 12:42 PM, Jason Green wrote: >> >>> I haven't touched virtual environments since I discovered docker in 2014. >>> If stuck on Windows, check out Docker for Windows. If unable to get to >>> Win10, check out Docker ToolBox or Vagrant. >>> >>> >>> On Fri, Mar 9, 2018 at 8:52 AM, Zak Kohler wrote: >>> >>>> I had forgot about this option: >>>> >>>> https://github.com/conda/constructor >>>> >>>> Does anyone have experience with conda constructor? >>>> _______________________________________________ >>>> CentralOH mailing list >>>> CentralOH at python.org >>>> https://mail.python.org/mailman/listinfo/centraloh >>>> >>> >>> >>> _______________________________________________ >>> CentralOH mailing list >>> CentralOH at python.org >>> https://mail.python.org/mailman/listinfo/centraloh >>> >>> >> >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> https://mail.python.org/mailman/listinfo/centraloh >> >> > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gjigsaw at gmail.com Tue Mar 13 19:06:11 2018 From: gjigsaw at gmail.com (Jason Green) Date: Tue, 13 Mar 2018 23:06:11 +0000 Subject: [CentralOH] State of Python Deployment In-Reply-To: References: Message-ID: What shuff said! Also, check out Docker for Mac or Docker for Windows (Win10) or Docker Toolbox ( wrote: > The way I would approach this is breaking down the problem into its > individual components and making sure that whatever I choose always allows > for a deterministic build/deployment process: > > 1. Choosing the right dependency management system to keep development > environments to stay consistent and easy (e.g. virtualenv, pipenv, etc) > 2. Choosing the right container imaging system to make sure your code and > dependencies to production is _always_ deterministic (docker, rpm/deb, etc) > 3. Choosing system for deploying your code to a server (google app > engine, heroku, kubernetes, local docker instance, etc) > > To expand on my one of my workflows: > > 1. When doing local python development I generally use virtualenv (and > virtualenvwrapper bash functions) to make it very easy for me to quickly > spin up my development environment on any platform and pull in all the > python dependencies without relying on any system libraries. This is > important for consistency when you're developing to make sure system-wide > packages that may differ across operating systems (linux, mac, windows, > etc) don't impact development. This is especially important to do based > on your "conflicting deps" comment. > > 2. Once I am done developing I need to "freeze" the external depencies my > code relies on, package it up, and create an immutable file system (aka > "image") of all code and dependencies . For this I simply freeze the state > of external python packages and use docker to build it: > > pip freeze > requirements.txt > docker build > > The docker build step is important to make sure that whenever I deploy my > code + dependencies it is always deterministic. More specifically it means > I should never have to rely on some outside pypi server to have a specific > version of the dependencies my code relies on. This means my code should > deploy out to my servers today, or in 3 years if I need to migrate to a new > server and the library versions I was pinned to are long gone. Hopefully > we all build our code more often than every 3 years but it is important > that even if we had to we could without any worries. > > If a docker-like deployment style isn't what you're going for another > alternative that I've used is using pex to create a python executable > with all your dependencies. It would > make deploying your software with an (rpm|deb|windows pkg mgr) much easier. > > > 3. There are countless ways to deploy your code and what you choose may > influence your decision for the container imaging system in #2. Spinning > up local docker instances on a laptop or server running your favorite linux > distro is extremely easy these days so it is a safe place to start. If > your python webapp is something on your local network or your blog docker > will be fine. If you need this to scale to many thousands of users and you > want to using a cloud deployment system google app engine is a decent > starting point. > > > Sorry that my answers are not very windows focused as I don't have any > relevant experience there. Hope this helps! > > Good luck! :) > > -- > shuff > > > > On Sun, Mar 11, 2018 at 10:26 AM, Erik Welch > wrote: > >> conda constructor is used to build installers such as the Anaconda >> distribution, so this probably isn't what you're looking for. >> >> >>> >>> *(mini)conda + conda env*? handles binary deps as well >>> *? how to pull package deps from an intranet store?* >> >> >> I believe what you're looking for is >> https://conda.io/docs/user-guide/tasks/create-custom-channels.html . It >> is definitely possible to host conda packages internally and to do so on >> your own. Some organizations do this without the help of Anaconda (the >> company I work for). If you want an enterprise-ready solution and support, >> then your company can pay my company Anaconda (businesses cater to other >> businesses, and this is a pain point we have solved for many >> organizations). If you want to go it alone, though, the requisite tools >> and technologies are freely available. >> >> I'm sure I'm biased, but it sounds to me like your use case is exactly >> why conda was created. There has been lots of good advice on this thread, >> though, and Docker and pipenv are also good at what they do. >> >> Good luck! >> Erik >> >> On Sun, Mar 11, 2018 at 11:37 AM, Eric Floehr >> wrote: >> >>> Jason, >>> >>> Docker seems like a great way to create completely reproducible >>> environments. What is your workflow, and are there any tools that make >>> managing Python environments "pipenv" (or mkvirtualenv/workon) easy? >>> >>> -Eric >>> >>> >>> On Fri, Mar 9, 2018 at 12:42 PM, Jason Green wrote: >>> >>>> I haven't touched virtual environments since I discovered docker in >>>> 2014. >>>> If stuck on Windows, check out Docker for Windows. If unable to get to >>>> Win10, check out Docker ToolBox or Vagrant. >>>> >>>> >>>> On Fri, Mar 9, 2018 at 8:52 AM, Zak Kohler wrote: >>>> >>>>> I had forgot about this option: >>>>> >>>>> https://github.com/conda/constructor >>>>> >>>>> Does anyone have experience with conda constructor? >>>>> _______________________________________________ >>>>> CentralOH mailing list >>>>> CentralOH at python.org >>>>> https://mail.python.org/mailman/listinfo/centraloh >>>>> >>>> >>>> >>>> _______________________________________________ >>>> CentralOH mailing list >>>> CentralOH at python.org >>>> https://mail.python.org/mailman/listinfo/centraloh >>>> >>>> >>> >>> _______________________________________________ >>> CentralOH mailing list >>> CentralOH at python.org >>> https://mail.python.org/mailman/listinfo/centraloh >>> >>> >> >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> https://mail.python.org/mailman/listinfo/centraloh >> >> > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From damiencalloway at gmail.com Thu Mar 29 18:55:06 2018 From: damiencalloway at gmail.com (Damien Calloway) Date: Thu, 29 Mar 2018 22:55:06 +0000 Subject: [CentralOH] [CoPhy] March 2018 Monthly Meeting Message-ID: PyOh March 2018 Great turnout, 77 people rsvp,d at least 40 came. Out of one case of pizza, one slice was left Two of the new people : Eric - Quant from Boston Trey - IoT, Python PyOhio is July 29-30 2018 @ the OHio Union. Looking for speakers and sponsors. PyCon is in Cleveland in May - is not free like PyOhio Guy Royce will speak about machine learning in April meeting 4-30-2018 Harry Linder spoke about how to create your own custom search engine We actually experimented with recording, looking for a spare camera for video recording This is up on GitHub - but where ? Lean into your edge - make connections Why build your own search engine ? Results are often inaccurate, incomplete also, there is a serious search bubble effect (unless you use Duck Duck Go) Surveys only get a small response, so each respondent has an outsized influence Start with accurate information Python - of course ! Flask - web framework Whoosh - search Scrappy + Portia - web scrapers Frames are very difficult- especially if they load things that do not refresh the page. Also used : Virtualenv - package management GitHub - store and share your code. And use for deployment Heroku - better than AWS for this purpose Cloud 9 - bought by AWS. Google errors- See project notes - Harry found AWS to be error prone Stackoverflow - Panic - not really Result : https://stormy-lowlands-80953.herokuapp.com Shout out to Lynda.com for the Flask tutorial ! Consider storing the code with the web site that you scrape Whoosh can index things without a dB . Beautiful Soup Travis spoke about pipenv - very good for package and dependency management -------------- next part -------------- An HTML attachment was scrubbed... URL: