Metadata-Version: 2.4
Name: pd-code-reverse-component
Version: 0.1.1
Summary: reverse all arc number in one certain component for a link pd_code.
License: MIT
License-File: LICENSE
Author: GGN_2015
Author-email: neko@jlulug.org
Requires-Python: >=3.10
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: pd-code-pre-nxt (>=0.1.0)
Requires-Dist: pd-code-sanity (>=0.1.0)
Description-Content-Type: text/markdown

# pd-code-reverse-component

Reverse the orientation encoding of one selected PD-code component.

## Installation

```bash
pip install pd-code-reverse-component
```

## Usage example

```python
from pd_code_reverse_component import reverse_component

pd = [[2, 3, 1, 4], [4, 1, 3, 2]]
reversed_pd = reverse_component(pd, 1)
print(reversed_pd)
```

## Algorithm

The selected label identifies its component cycle through predecessor/successor maps. The cycle is placed in canonical order and mapped to its reverse order. Every occurrence of a component label is replaced through that bijection; labels belonging to other components remain unchanged. The operation returns a deep copy and leaves the input untouched.

## Input conventions

A PD code is represented as a list of four-entry crossings. Arc labels normally occur exactly twice. Public functions validate inputs and return new values rather than mutating caller-owned data unless their API explicitly says otherwise.

## External software

No external software is required.

## Development

Run examples and package checks before release. Python packages require Python 3.10 or newer. Build PyPI artifacts with:

```bash
poetry check
poetry build
```

## License

MIT. See `LICENSE`.

