ITの隊長のブログ

ITの隊長のブログです。Rubyを使って仕事しています。最近も色々やっているお(^ω^ = ^ω^)

matplotlibを勉強した

これまでなんとなーくで扱っていたグラフモジュールですが、ここ最近、基礎集計な案件がめっちゃ増えそうなのでここいらで基礎固めようと勉強した(写経)

参考にした本はこちら

PythonユーザのためのJupyter[実践]入門

PythonユーザのためのJupyter[実践]入門

成果物

github.com

第4章をやった。5章はなんか玄人向けっぽいが基礎集計であまり扱わなさそうなので明日流し見する予定である

Pythonでドキュメント作成

概要

モジュール開発終わったら、ドキュメント作成ですが、面倒なので、生成する方向でやりました。

モジュールのdocstring

GoogleスタイルのPython Docstringsの例 — Sphinx 1.5.6 ドキュメント

Googleが好みだったのでこれでコメントを書いた

わかりやすいREADME

参考

わかりやすいREADME.mdを書く | SOTA

Sphinx

qiita.com

こっちがわかりやすかった。

reStructuredText

reStructuredText入門 — Sphinx 1.5.6 ドキュメント

4. Sphinxでの文章の書き方(reStructuredText) — study sphinx 1 documentation

リファレンスページが最強

themeの変更

build inで用意されているのがいくつか存在する.

HTMLテーマのサポート — Sphinx 1.5.6 ドキュメント

sphinxのハマり

build inされたテーマに変更できない

stackoverflow.com

デフォのテーマで必要な何かをコメントアウトすればよいとのこと.

(ERROR/3) Unknown directive type "seqdiag".

sphinxcontrib-seqdiag — blockdiag 1.0 documentation

入っていないディレクティブは使わないか、使いたきゃinstall

autodocってどうなんじゃろ?

# If extensi

ons (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('.'))

この辺のコメントを外す。

class, packagesを図にする

qiita.com

DBスキーマをrstへ変換する

mysqlpostgresqlも対応しているので良い

tk0miya.hatenablog.com