chrisphan.com

Mastodon posts for 2025-W44

An analog clock reading 1:00 2025-11-06 / 2025-W45-4T13:00:00-06:00 / 0x690cf030

Categories: Mastodon

I agree with @emilydoesastro : uv is really awesome for environment and package management. I have been using it a lot recently.

emily.space/posts/251023-uv

Chris Phan,

@emilydoesastro One neat thing that uv allows is for you to make standalone scripts that specify the external packages needed.

docs.astral.sh/uv/guides/scrip

Screen shot of the start of a Python script:  file: build.py  #!/usr/bin/env -S uv run --script # # /// script # requires-python =  >=3.11  # dependencies = [ requests ,  psycopg[binary] ] # /// # # SPDX-License-Identifier: MIT    Build the U.S. Population Chains database.     from __future__ import annotations  __author__ =  Christopher L. Phan, Ph.D.  __copyright__ =  Copyright 2025, Christopher L. Phan, Ph.D.  __credits__ = {__author__} __date__ =  2025-10-29  __license__ =         Copyright 2025 Christopher L. Phan, Ph.D.  Screenshot cuts of there.

Chris Phan,

Timestamp stored in microseconds, not seconds. Oops! 🤦🏽‍♂️

Screenshot of terminal (I have removed some of the lines consisting of spaces, tildes, and carets that point to the exact position of the error in the source code):  Processed 29010 (90%) (641.74778 s) Saving the database import instructions to  import_to_maria_pop_chain_build_1762144120827454.sql... (641.76971) Traceback (most recent call last):   File  /Users/chris/Documents/projects/sandbox_3/pop_chains_reproducible/./build.py , line 1192, in <module>     timer, table = dump_pg(config, db, len(ident_list), timer)    File  /Users/chris/Documents/projects/sandbox_3/pop_chains_reproducible/./build.py , line 1172, in dump_pg     + f INSERT INTO db_info VALUES ('{db.creation.isoformat()}');     File  /Users/chris/Documents/projects/sandbox_3/pop_chains_reproducible/./build.py , line 572, in creation     return datetime.datetime.fromtimestamp(self.timestamp)  ValueError: year must be in 1..9999, not 55842094

Chris Phan,

Let's hope they remove this limitation before the year 10000 🤣

Chris Phan,

Ten most populous Census-designated places in the USA. (Data from 2020 U.S. Census)

Screenshot of terminal. User has entered this SQL statement:  SELECT place_name, state_name, population FROM places WHERE place_type = 'cdp' ORDER BY population DESC LIMIT 10;  The results are shown in a table. They are:  Urban Honolulu, Hawaii, population 350964 Arlington, Virginia, population 238643 Enterprise, Nevada, population 221831 Spring Valley, Nevada, population 215597 Sunrise Manor, Nevada, population 205618 Paradise, Nevada, population 191238 Metairie, Louisiana, population 143507 East Los Angeles, California, population 118786 Brandon, Florida, population 114626 The Woodlands, Texas, population 114436

Chris Phan,