Skip to main content

Compass Python Lib

Conversion commands:

# Install in dev mod
pip install -e ".[dev,test]"

# Install latest stable version
pip install compass_lib

# run some commands
compass convert --input_file=./tests/artifacts/fulford.dat  --output_file=fulford.json --format=json --overwrite
compass convert --input_file=./tests/artifacts/random.dat  --output_file=random.json --format=json --overwrite

GeoJSON section colors

GeoJSON survey legs include properties.color, an opaque CSS #rrggbb color. Every shot in a DAT survey block receives the same generated section color. Sections sharing a station have different colors, including across MAK-linked DAT files. Names alone do not identify sections or station connections: the existing MAK station-scoping rules remain authoritative. Geometric crossings without a shared station do not create a color constraint.

The palette lives in compass_lib/constants.py as SURVEY_COLORS: vivid red, orange, yellow, lime, green, mint, cyan, blue, purple, and hot pink. Both palette colors and generated overflow colors have HSV saturation of at least 80% and value of at least 90%, excluding black, white, gray, and muted shades.

Assignment uses ordinary random choices in at most 16 iterative passes, without hashing, a fixed seed, or algorithm versioning. It stops on completion or no improvement. Remaining sections receive distinct vibrant colors using a finite fallback budget sized to the input, so reaching the pass limit does not leave touching sections with the same viewer fallback color. Colors can change when GeoJSON is regenerated and remain fixed in each stored artifact.

See GeoJSON section coloring for pass semantics, fallback bounds, the color-space limit, export behavior, and test coverage.

CompassSurvey.color is derived metadata assigned during coordinate computation; it is excluded from source JSON and DAT/MAK serialization. SurveyLeg.color carries it through coordinate propagation and adjustment. Passage polygons and clipped passage fragments inherit their leg's color. Station/anchor and misclosure styling retain their existing semantics.

The color property is independent of color_by_origin and CLI --no-colors, which still control origin-based simplestyle stroke/marker-color styling. Clients can use color for shot rendering and fall back to the survey color for legacy data without it. Existing saved GeoJSON must be regenerated to gain these properties; no source files are rewritten. Palette changes also require regenerating stored GeoJSON; existing artifacts retain the colors recorded when they were exported.

Portable regression coverage lives in tests/test_section_colors.py, including duplicate names, linked/scoped stations, crowded junctions, solver paths, round trips, CLI/API exports, vibrant colors, and safe budget exhaustion. Private fixtures remain additional coverage and are never required for these guarantees.

Metadata

Release files for compass-lib 0.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for compass-lib 0.0.9
File Size Uploaded
compass_lib-0.0.9.tar.gz 88.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for compass-lib 0.0.9
File Interpreter ABI Platform
compass_lib-0.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 193.6 kB

Release files / compass_lib-0.0.9.tar.gz

Download URL compass_lib-0.0.9.tar.gz
Size 88.3 kB
Tags Source
SHA-256 checksum
How to use checksums
bf98732614836da9c184e2304f42ceb70934b51a6d477161333788cc87a53b26
BLAKE2b-256 checksum
How to use checksums
83caf03bedfb7825702e0a7e80ff076a3c2b56c39e3c57a8d2cfb9f78507dafb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / compass_lib-0.0.9-py3-none-any.whl

Download URL compass_lib-0.0.9-py3-none-any.whl
Size 105.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea54fc82b2f7b8fbc89f7ebbf04cdf0f56724a51be3c6c70874668ad914fde29
BLAKE2b-256 checksum
How to use checksums
42004b06f1b705a3ce43a1168f43d1ebfc4f50a2a60fe0408a768410a232c85c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.9 This release

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page