semvec/pypi-packages huggingface dataset:
cutting-stock 0.1.3
A Python implementation of the cutting stock problem solver
Requires Python: >=3.10

# Cutting Stock Problem

A CVXPY implementation of the [cutting-stock problem](https://en.wikipedia.org/wiki/Cutting_stock_problem).

## Installation

The project is available on [PyPI](https://pypi.org/project/cutting-stock/). You can install it using pip:

```bash
pip install cutting-stock
```

Alternatively, if you are a `uv` user, you can install the associated CLI directly:

```bash
uvx cutting-stock
```

or you can add it to your environment dependencies:

```bash
uv add cutting-stock
```

## Command Line Options

``` console
-r, --roll_length: The length of the roll. E.g. -r 12.0
-l, --lengths: The lengths of the items. Must be a list of floats. E.g. -l 3.4 3.0 2.7
-q, --quantities: The quantities of the items. Must be a list of floats. E.g. -q 34 13 5
-s, --solver: The solver to use. Must be either GLPK or ECOS. E.g. -s GLPK
-g, --ge_required: If specified, the constraint is >= instead of ==.
--verbose: If specified, the output will be more verbose.
```

### Example

```bash
uv run cutting-stock -r 12.0 -l 3.4 3.0 2.7 -q 34 13 5
```

This produces the following output:

```console
> uv run cutting-stock
Required pieces:
███ 3.4m ×34   ▓▓▓ 3.0m ×13   ▒▒▒ 2.7m ×5
Stock length: 12m

Solution: 16 stocks of 12m each, 23.9m waste

Use 10× → 3.4m |3.4m |3.4m |1.8m
          █████|█████|█████|···· (12m stock)
Use  2× → 3.4m |3.4m |2.7m|2.5m
          █████|█████|▒▒▒▒|···· (12m stock)
Use  3× → 3.0m |3.0m |3.0m |3.0m 
          ▓▓▓▓▓|▓▓▓▓▓|▓▓▓▓▓|▓▓▓▓▓ (12m stock)
Use  1× → 3.0m |2.7m|2.7m|2.7m|0.9m
          ▓▓▓▓▓|▒▒▒▒|▒▒▒▒|▒▒▒▒|···· (12m stock)
```

## Setup Development Environment

1. This project uses [uv](https://docs.astral.sh/uv/) for fast Python package management. If you don't have uv installed, you can install it with: Install `uv`:

   If you have `curl` installed, you can run:

   ```bash
   curl -LsSf https://astral.sh/uv/install.sh | sh
   ```

2. Clone the repository:

   ```bash
   git clone <repository-url>
   cd cutting-stock
   ```

3. You can run commands directly with uv without activating the environment or manually installing dependencies:

   ```bash
   uv run cutting-stock
   ```

## Development

### Running Tests

```bash
uv run pytest
```

### Code Formatting and Linting

```bash
uv run ruff check src/
```

## Dependencies

- **scipy**: Scientific computing library
- **numpy**: Numerical computing library
- **cvxpy**: Convex optimization library
- **cvxopt**: Convex optimization library

## License

MIT License
django-nativeshortuuidfield 1.4.11
A decoder/encoder Field for uuid
Requires Python: >=3.10
Keywords: shortuuid, uuid, nativeshortuuid

# django-nativeshortuuidfield

[![Tests](https://github.com/foundertherapy/django-nativeshortuuidfield/actions/workflows/tests.yml/badge.svg)](https://github.com/foundertherapy/django-nativeshortuuidfield/actions/workflows/tests.yml)
[![Linters](https://github.com/foundertherapy/django-nativeshortuuidfield/actions/workflows/linters.yml/badge.svg)](https://github.com/foundertherapy/django-nativeshortuuidfield/actions/workflows/linters.yml)

Provides a NativeShortUUIDField for your Django models which uses the base-57 "Short UUID" package at https://github.com/stochastic-technologies/shortuuid/ to be used in Python
and store it as full UUID in database.

## Installation

Install it with pip (or easy_install):
```bash
$ pip install django-nativeshortuuidfield
```

## Usage

First you'll need to add a NativeShortUUIDField to your class:
```python
from native_shortuuid import NativeShortUUIDField

class MyModel(models.Model):
    uuid = NativeShortUUIDField(unique=True, default=uuid.uuid4)
```

If you want to add the ability to search by shortuuid in `ModelAdmin` you need to inherit `NativeUUIDSearchMixin`
```python
from native_shortuuid.admin import NativeUUIDSearchMixin

@admin.register(models.MyModel)
class MyModelAdmin(NativeUUIDSearchMixin, admin.ModelAdmin):
    search_fields = ('uuid', )
``` 

If you want to have to ability to write your own uuid search fields list
```python
from native_shortuuid.admin import NativeUUIDSearchMixin

@admin.register(models.MyModel)
class MyModelAdmin(NativeUUIDSearchMixin, admin.ModelAdmin):
    admin_auto_extract_uuid_search_fields = False
    search_fields = ('name', )
    search_uuid_fields = ['uuid', 'foreign_model__uuid']
``` 


Enjoy!

## Settings
* `ADMIN_AUTO_EXTRACT_UUID_SEARCH_FIELDS`: default `True`
    + This setting is to autofill `search_uuid_fields` in the ModelAdmins that inherits `NativeUUIDSearchMixin` 
    with all shortuuid fields that are in the `search_fields` array.
    if you turned it off, you'll need to define `search_uuid_fields` on you ModelAdmin in order to search on shortuuid fields
    
## Notes

* NativeShortUUIDField is a subclass of django.db.models.UUIDField

* You can pass usual Django UUIDField parameters on init, although some of them are added/overwritten:
    + blank=True, editable=False (set auto=False to remove these fields enforcement)

### Contribution Notes

#### Pull Request
* Increase the version number in the `setup.py` to the new version that the new pull request represents.

#### Publishing the Package
After the pull request gets merged into the master branch a new release should be created

* Create a new tag with the same version number you updated the `setup.py` with:
    ```bash
    $ git checkout master
    $ git tag -a 2.1.0 -m 'fix importing order'
    $ git push origin 2.1.0
    ```

* Go to GitHub's releases section and create a new release:
    + Chose the tag version that you just created
    + Fill the release title with the same version number
    + Add a description of the release and publish it