Comments (14)
I can confirm that. I've opened an issue for the matplotlib repository. blacken-docs
worked perfectly on this one.
from hsf-training-ml-webpage.
Thanks for opening your first issue here! If you have any questions, feel free to mention one of the conveners, previous contributors, or attend our weekly meeting (see https://hepsoftwarefoundation.org/workinggroups/training.html). Also, sometimes issues go unnoticed, so don't hesitate to @mention some of us, if we do not come back to you within a few days.
from hsf-training-ml-webpage.
Agreed!
from hsf-training-ml-webpage.
I had a question. Is there a way/package to run some code on the entire episode/lesson, and it automatically updates the python parts and formats them?
from hsf-training-ml-webpage.
Yes, I think https://github.com/asottile/blacken-docs does exactly that (though it might depend a bit on which markdown syntax is being used for the code inclusion).
Feel free to try with that!
from hsf-training-ml-webpage.
Yeah, I'm not sure if it understands the
~~~
import pandas as pd # to store data as dataframe
import numpy as np # for numerical calculations such as histogramming
import matplotlib.pyplot as plt # for plotting
~~~
{: .language-python}
inclusions. Can you confirm that?
from hsf-training-ml-webpage.
Thanks for the answer.
I tried the following test based on your question.
I tried running blacken-doc on the above test snippet which I stored in a .md file.
Nothing happens. No reformatting. It doesn't give any error.
- If I change the comment position by introducing a , blacken-docs will not re-format.
- Although it works well if we use the following:
# ~~~
import pandas as pd # to store data as dataframe
import numpy as np # for numerical calculations such as histogramming
import matplotlib.pyplot as plt # for plotting
# ~~~
- Using black directly on the snippet, re-formats the snippet: here is the black reformatted snippet
import pandas as pd # to store data as dataframe
import numpy as np # for numerical calculations such as histogramming
import matplotlib.pyplot as plt # for plotting
from hsf-training-ml-webpage.
I assume the second thing is then a .py
file, right?
Yes, also according to blacken-docs readme the ~~~
doesn't seem to be recognized...
I'll try to fork the project and see if we can easily hack together a version that support this
from hsf-training-ml-webpage.
I've forked blacken-docs: If you install my version (by cloning the repo and then pip install .
), blacken-docs will recognize the other syntax as well.
I'll see if I can bring it into the official version...
from hsf-training-ml-webpage.
I've also just tested that and already fixed the issues in this webpage, but I'm sure our other repositories have similar problems...
from hsf-training-ml-webpage.
So if you're interested in this @amanmdesai feel free to apply my modified blacken-docs there :)
Having best-practice formatting is definitely something that we should do!
from hsf-training-ml-webpage.
I've forked blacken-docs: If you install my version (by cloning the repo and then
pip install .
), blacken-docs will recognize the other syntax as well.I'll see if I can bring it into the official version...
Forgot to push. Please version as of now :)
from hsf-training-ml-webpage.
See adamchainz/blacken-docs#177
from hsf-training-ml-webpage.
Hi, thanks for the updates.
there seems to be one more issue:
pip install ...
does not seem to work. I see the following error on a different file.
command : blacken-docs 05-mplhep.md
Result 05-mplhep.md:27: code block parse error Cannot parse: 1:4: pip install mplhep
needs more fixing maybe?
from hsf-training-ml-webpage.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hsf-training-ml-webpage.