Refactor and add opinionated_min style with example#2
Refactor and add opinionated_min style with example#2saforem2 wants to merge 47 commits intoMNoichl:masterfrom
opinionated_min style with example#2Conversation
Update README.md
|
sorry, just your comment about building / publishing! You can use hatch: (I like the dynamic versioning 🤷🏻♂️ ) $ hatch version
0.0.1
$ hatch build
[sdist]
dist/opinionated-0.0.1.tar.gz
[wheel]
dist/opinionated-0.0.1-py3-none-any.whl
8.75s user 1.16s system 78% cpu 12.589s total
$ hatch publish -r test
Enter your username: saforem2
Enter your credentials:
dist/opinionated-0.0.1.tar.gz ... success
dist/opinionated-0.0.1-py3-none-any.whl ... successHonestly I was initially reluctant about the reorg / big changes, but it is called opinionated so I took some liberties 😂 |
|
Hey, very nice! What's the reasoning behind the |
|
yeah that makes sense.
yeah no worries! I have a few other ideas for changes to things that I'll keep playing around with One thing I was thinking about: It seems the only differences (currently) between the One thing we could do would be to split up the from opinionated import use_font, use_style
use_font('IBM Plex Sans') # 'Roboto Condensed', ...
use_style('transparent') # 'default', 'light', 'dark', 'bright', ...so that you could define / configure these components individually as needed. |
|
Also, I've updated started updating this currently a WIP and I need to add back in what you had in there originally, but just thought I'd point it out |
|
I also noticed you had this I've recently been independently working on simplifying this process for a bunch of my other projects / repos.
if that's something you'd be interested in 🤷🏻♂️ |
|
Hey, thank you for all your work! Should I convert this into a branch? Maybe that makes it easier to go forward. Sure, let's talk! I'm also happy to talk via Zoom or something. Maybe that's quicker. Hmm. I don't think I want to encourage that to be honest. My idea with the opinionated package is that it should not only make it easy to get plots with better fonts but also discourage people from making bad choices (that's the opinionated part). So I gave some thought about which fonts to include, and I'm actually thinking more about kicking out some of the styles that I include at the moment – Montserrat will not look good in most plots, because it's too wide, and although I love the font, a similar thing is true for Space Grotesk – than adding or encouraging other fonts. I was also thinking about finetuning the designs (margins, sizes etc.) for individual fonts in the future, haven't gotten around to it though. To me it seems that the font/style thing, if set as a default encourages experimentation, while the current code (download & set font) enables it, but doesn't force the issue. Of course, I see why, from a programmer's perspective of code-reusability, your solution would be quite elegant. Also, I'm actually not a big fan of a dark mode for plots. I just don't think I see them used effectively that often, even on dark websites. So I somewhat consciously did not include them. But as people apparently will want to use them, maybe we should have one well-designed dark mode as a feature. Maybe similar to the hrbrthemes ft-theme. This could be set by doing something like I do like plots with greyish-beige backgrounds, and am planning to do a clone of opinionated, which allows you to make pastiches of historic datavis, with works by Nightingale, Playfair, Minard, Neurath, etc. but I feel that's best left to a different project. I actually meant to delete these notebooks, as I have stopped using them. Probably it would be better to have a script generate the plots than a notebook anyway (?). That does look cool! I was thinking of doing some sphinx docs, but then I felt that the project is small enough that we don't really need docs (?) |
|
yeah definitely, I'm wrapped up today and tomorrow but might have some free time Friday afternoon if you're available and still want to hop on a zoom call to discuss further
fair enough, honestly I was interpreting it as the users being the opinionated ones, i.e. allow them to easily customize / modify existing themes (with sensible opinionated defaults), which I guess is really a different end goal than you might've had in mind.
again, completely fair point (and I know a lot of people don't particularly like dark themes in general) An easy fix, in my opinion, is to use a single style with:
which is what I was going for in the e.g.
but honestly if you have different goals in mind for this project (and/or would prefer to maintain that vision and keep things as is), I can abandon this pull request and just create a new repo / project and mention that it is an offshoot of |
yeah, if that would be easier for you that's totally fine with me. I've done some additional poking around and I'm almost positive everything from the original implementation still works as is, with some additional features added (coming from the TODOs in the original project, e.g.
|
Changes:
src/opinionated/data/*.mplstyletostylefiles/*.mplstylesrc/opinionated/fonts/*from gitsrc/opinionated/{__init__.py,core.py}to:import opinionatedfonts/in the project root{setup.py,setup.cfg}, only usepyproject.toml.gitignoreopinionated_minexample in README andstylelib/opinionated_min.mplstyle