semvec/pypi-packages huggingface dataset:
cwe-tree 1.1.2
A Python package for querying CWE trees
License: MIT
Requires Python: >=3.12

# CWE Tree

Python package for querying the Common Weakness Enumeration (CWE) hierarchy as a multi-rooted forest structure.

## Quick Start

```python
from cwe_tree import query

# Get a node
node = query.get_cwe("CWE-79")  # Both "79" and "CWE-79" works

# Navigate relationships
parents = query.get_parents("CWE-79")
children = query.get_children("CWE-79")

# Get metadata
metadata = query.get_metadata("CWE-79")

# Traverse forest
roots = query.get_root_nodes()
descendants = query.descendants(node)
ancenstors = query.ancenstors(node)

# Subnode Check
query.is_ancestor("CWE-74", "CWE-77")  
query.is_descendant("CWE-77", "CWE-74") 

# Visualize structure
query.show()                    # Display entire forest
query.show("CWE-79")          # Display subtree from specific node
```

## Install

```bash
pip install cwe-tree

# With dev tools (linters, type checker, jupyter)
pip install -e ".[dev]"
# or
uv sync --dev
```

## API

### Core Methods

| Method | Purpose |
|--------|---------|
| `node(cwe_id)` | Get node by ID |
| `nodes(predicate=None)` | Iterate all nodes with optional filter |
| `get_parents(cwe_id)` | Get parent nodes |
| `get_children(cwe_id)` | Get child nodes |
| `get_metadata(cwe_id)` | Get complete node metadata with relationships |
| `get_layer(cwe_id)` | Get layer/depth information |
| `get_root_nodes()` | Get all root nodes (no parents) |
| `show(cwe_id=None)` | Visualize forest structure with ASCII tree |

### Traversal (inherited from AbcGraphQuerier)

| Method | Purpose |
|--------|---------|
| `succ(node, predicate=None)` | Get successor nodes |
| `prev(node, predicate=None)` | Get predecessor nodes |
| `descendants(node, max_depth=None)` | BFS to find all descendants |
| `ancestors(node, max_depth=None)` | BFS to find all ancestors |
| `edges(predicate=None)` | Iterate all edges |
| `first_node(predicate=None)` | Get first matching node |

## Data Model

- **Forest Structure**: Multiple independent trees with different roots (CWEs with no parents)
- **Edge Type**: "PARENT_OF" edges flow parent → child
- **Node Properties**: id, name, abstract (Class/Base/Variant), layer (depth in hierarchies)

## Documentation
- **[docs/demo.ipynb](docs/demo.ipynb)** - Interactive usage examples (Jupyter)
- **[docs/design.md](docs/design.md)** - Architecture, concepts, data contracts
- **[docs/forest.txt](docs/forest.txt)** - Detail structure of CWE Forest


## Development

### Code Quality

All code must pass (perfect score maintained):

```bash
make quality  # Run all checks

# Or individually:
uv run isort --check-only src/
uv run black --check src/
uv run mypy src/
uv run pylint src/
```

### Format Code

```bash
make format
```

### Run Tests

```bash
# Coming soon - comprehensive test suite
```

## Architecture

See [docs/design.md](docs/design.md) for:
- Problem statement and system role
- Core concepts (nodes, trees, forest structure)
- Project structure
- Data contracts
- Typical scenarios and boundary cases

## License

MIT

---
voxelium-apex 0.1.0
Voxelium-apex: a package for cryoEM/cryoET heterogeneity reconstruction analysis and visualization
License: MIT
Requires Python: <3.13,>=3.9

# Voxelium-apex 

This repository contains the voxelium-apex codes -- a package for cryoEM/cryoET heterogeneity reconstruction analysis and visualization.

## Installation 
### Install from PyPI
First create and activate a Conda or standard Python virtual environment. Then install the prebuilt wheels distributed via PyPI:
```pip install voxelium-apex```


### Build from source
After cloning the repository and navigating (`cd`) into the project directory, first create and activate a Conda or standard Python virtual environment.
```pip install .```


## 3D Spectral Heterogeneity Analysis (SHA)
Run `vxm-apex -h` to see a list of modules.
To run the analysis, the sha3D module can be run as follows:

```vxm-apex sha3d <input_star_data> <log_directory> --gpu 0```

Here, `<input_star_data>` is an input STAR-file containing all the particles with CTF and pose parameters set.
`<log_directory>` will contain the results of the job. 

NOTE: Adding `--preload` speeds things up considerably, assuming the dataset fits in memory.

NOTE: You need to install extension for this, see above.

## SHA3D Visualization

To visualize the results run:

```vxm-apex sha3d_viewer <log_directory>```

In the above, `<log_directory>` is the path to the directory containing the results of the SHA3D analysis, see above.


## 🤝 Contributor covenant code of conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to opensource@chanzuckerberg.com.

Responsible Use: We are committed to advancing the responsible development and use of artificial intelligence. Please follow our [Acceptable Use Policy](https://virtualcellmodels.cziscience.com/acceptable-use-policy) when engaging with the model.

## 🔒 Security

If you believe you have found a security issue, please responsibly disclose by contacting us at security@chanzuckerberg.com.