semvec/pypi-packages huggingface dataset:
xcorduroy 0.0.2
Dask aware lightweight DEM utilities for Xarray
Requires Python: >=3.13

# xCorduroy - Dask aware lightweight DEM utilities for Xarray

`xcorduroy` is a lightweight (`dask`, `numpy`, `xarray` and `xproj`) Xarray accessor for library for calculating hillshade, slope angle and aspects from DEMs. 

**Warning: experimental**


## Usage

#### Installation

```python
uv add xcorduroy
# or 
pip install xcorduroy
```

#### Notebooks
An example notebook can be found in `notebooks/DEM_example.ipynb`


#### Example
```python
import xarray as xr
import xcorduroy # This is needed for the .dem accessor
import xproj # This is needed for the .proj accessor

# Load a 2D Raster DEM
ds = xr.open_dataset("DEM.zarr", engine="zarr", chunks="auto")

# Make sure you have a crs registered
ds = ds.proj.assign_crs("EPSG:4326")

# Calculate hillshade. Note you can use the `dem` accessor.
hillshade = ds['dem'].dem.hillshade()
slope = ds['dem'].dem.slope()
aspect = ds['dem'].dem.aspect()


# Plotting
fig, axes = plt.subplots(2, 2, figsize=(12, 10), sharex=True, sharey=True)

ds['dem'].plot(ax=axes[0, 0], cmap='terrain', add_colorbar=True)
axes[0, 0].set_title("Input DEM")

slope.plot(ax=axes[0, 1], cmap='magma')
axes[0, 1].set_title("Slope")

aspect.plot(ax=axes[1, 0], cmap='twilight')
axes[1, 0].set_title("Aspect")

hillshade.plot(ax=axes[1, 1], cmap='gray')
axes[1, 1].set_title("Hillshade")

plt.tight_layout()

```


### Methods
The three current methods implemented are `.hillshade()`, `.slope()` and `.aspect()`.  The hillshade method is based off of the `Horn, 1981` method. Details can be found in `src/xcorduroy/DEM.py`. They are inspired by similar methods in `xdem` and `xarray-spatial`. If you are looking for well-validated functions for scientific analysis, check out either of them.  This library is a limited scope lightweight take on some of the methods, not a replacement. 

## Development

This project uses `uv` for dependency management, `pytest` and `hypothesis` for testing,  `ty` for type-checking and `ruff` for linting. 


### Sync development environment 

```python
uv sync --all-extras
```


### Run type checking
```python
uv run ty check 
```

### Run linter

```python
uv run pre-commit run all-files
```

### Run tests
```
uv run pytest tests/
```


#### What's in the name

Corduroy is a textured snow surface left by groomers that forms regular peaks and valleys.
pctheory 0.0.44
A package with functionality for atonal music theory
Requires Python: >=3.10

# `pctheory`
`pctheory` is a Python library for using atonal music theory. It is useful for both computer-assisted composition in Python and analysis. Some of the many useful features include:
- Set-classes
    - Generate all abstract subsets of a set-class
    - Get Forte and Carter names for a set-class
    - Work with microtonal sets
    - Generate set-class-complexes
- Rows
    - Generate a twelve-tone matrix
    - Generate a rotational array
    - Generate an invariance matrix
    - Load a random all-interval, all-trichord, ten-trichord, or Babbit ten-trichord row
    
`pctheory` is much more specialized than `music21`, and offers substantially more functionality in atonal theory. Additionally, it does not use `music21` objects, so there is less computational overhead when using `pctheory`. It is not difficult to create `music21` objects from `pctheory` objects, which allows `pctheory` to be used along with `music21`.

## Installation
`pctheory` is a Python package and can be installed with the command `pip install pctheory` from the terminal on your computer (Command Prompt or PowerShell on Windows, Terminal on Linux or macOS). Note that you need Python 3.10 or newer.

If the `pip install` command fails, you will need to build the wheel yourself. Create a virtual environment with the packages `build`, `setuptools`, and `wheel` installed. Then run the command `python -m build` from the root of this repository. The wheel will be found in the `dist/` directory.

## Quick start
There are three Jupyter notebooks in this repository that you can consult to get started with `pctheory`.

## Stability
`pctheory` is currently in alpha status. This means that some functionality might not be stable yet. In particular, there isn't unit test coverage for the whole package at this point. However, the core functionality (such as pitch class operations, set-classes, and row functionality) does have test coverage and should be stable.
To see current testing coverage, you can take a look at the tests in the `tests` directory.

## System Requirements
`pctheory` requires Python 3.10 or newer.

## Documentation
Documentation can be found at https://pctheory.readthedocs.io/en/latest/.

## Copyright and license
`pctheory` is copyright © 2024 by Jeffrey Martin. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. To view the GNU General Public License v.3.0, visit https://www.gnu.org/licenses/gpl-3.0.en.html.