Auto center with caption for images in Hugo

Create a file: layouts/_default/_markup/render-image.html: 1 2 3 4 5 6 <figure class="align-center "> <img loading="lazy" src="{{ .Destination | safeURL }}#center" alt="{{ .PlainText }}" > {{ with .Text }} <figcaption><p>{{ . | safeHTML }}</p></figcaption> {{ end }} </figure> Then magic happens: 1 ![sample](/img/nmc-bin/RADAR_L3_MST_CREF_GISJPG_Tiles_CR_20250126_13_06_3_2_6.png) Render as: sample

 · 1 min · 45 words · ringsaturn
China’s first WSR-88D Doppler weather radar (Image source: [The Paper](https://www.thepaper.cn/newsDetail_forward_26004388))

Historical Fragments of China's Meteorological Radars

Some historical fragments discovered while researching.

 ·  · 11 min · 5139 words · ringsaturn

Better Python Project Maintenance

In the process of maintaining PyPI packages and projects, I often encounter two main pain points: Complexity of Uploading and Publishing: In the past, uploading a PyPI package typically required configuring a PyPI Token, which poses a security risk. It also required local or CI packaging and uploading. For projects involving .whl files, additional environment configurations were necessary, which added to the workload. Slow Dependency Locking: Larger Python projects often have many sub-dependencies, and not locking versions can lead to compatibility issues due to upstream changes. Traditional tools like PDM and Poetry are somewhat slow when locking dependencies, and the process can be frustrating. Back in 2021, I used Poetry to lock a project’s dependencies, and after 10 minutes, it still failed; since then, I haven’t used it. Fortunately, solutions for these issues have emerged in recent years. ...

 · 4 min · 644 words · ringsaturn

What Does the Python Version Number x.y Actually Mean?

At work, we use uv to manage Python projects, which allows us to quickly install dependencies and lock sub-dependency versions. After returning from a period of leave, I routinely updated the packages on my computer and noticed that uv had a new version, so I updated it. However, after updating the uv.lock file in a project, I found that many wheels for dependencies had disappeared from the lock file. For example, here’s the configuration of the pyproject.toml file: ...

 · 3 min · 441 words · ringsaturn

Better work status

I want to share 2 storirs about me on handling work status: Short term remote work Get more focus time in the morning Life in Suzhou Back in the summer of 2021, my house rental was canceled by the owner, and I had to move to another place. By then, the renting prices in Beijing were too high for me to rent a house. Fortunately, I was lucky enough to book a house one month after my current house was canceled. So, I needed to find a place to live for one month. My friend decided to move to Suzhou, a city near Shanghai, which is much more affordable than Beijing. For a month, I sat in a coffee shop and worked remotely. ...

 · 3 min · 509 words · ringsaturn

Publish crates documentation to GitHub Pages

 · 1 min · 127 words

Python you let me down

Personally, I’m very disappointed about the some Python community people/projects. It’s been years that PEP 3000(the year was 2006) came up, but we need to wait years until Python 3.11(the year was 2022) to get real performance improvements? Why people keep using Python and spending lots of time to add typing which doesn’t have run time check instead of rewriting codes in Go to get huge speed up while enjoying static language’s safe static type? ...

 · 2 min · 236 words · ringsaturn

Thought on Python's DataFrame

Note ...

 · 2 min · 254 words · ringsaturn

History of package tzf

The basic development work of tzf and related projects has basically stabilized. In the previous article, there are sporadic information about the development and design process: 2022-05-29, 在 Go 中将经纬度转时区 2022-08-01, Python 中经纬度转时区新的选择 2022-08-27, 用 Go 编写 Python 扩展 2022-09-10, tzf 预览图制作 2022-11-24, tzfpy Rust 重写 This article is the final summary, from the start-up of the project to the gradual optimization and evolution. ...

 · 4 min · 1875 words · ringsaturn

Deploy Hugo pages via GitHub Actions

 · 1 min · 124 words · ringsaturn