semvec/pypi-packages huggingface dataset:
prob-failure-toolkit 0.1.0a1
A toolkit for probabilistic failure analysis of mechanical components
Requires Python: >=3.7

# Probabilistic Failure Analysis Toolkit

A Python toolkit for performing probabilistic failure analysis on mechanical components. This tool allows engineers to simulate component behavior under various uncertain conditions (forces, dimensions, material properties) using Monte Carlo simulations.

## Features

*   **Monte Carlo Simulation**: Run thousands of simulations to understand the probability of failure.
*   **Sensitivity Analysis**: Identify which input variables have the biggest impact on your results using Spearman rank correlation.
*   **Engineering Formulas**: Built-in formulas for common mechanical elements:
    *   **Shafts**: Torsional shear stress, Von Mises stress.
    *   **Beams**: Bending stress, deflection.
    *   **Gears**: Lewis bending stress, contact stress.
    *   **Sheet Metal**: Shearing force, bending force.
*   **Visualization**: Generate plots for stress distributions and sensitivity analysis.

## Installation

1.  Clone the repository.
2.  Install the required dependencies:

```bash
pip install numpy matplotlib scipy
```

## Usage

The `demo.py` file contains a complete example of how to use the toolkit to analyze a cantilever beam.

To run the demo:

```bash
python demo.py
```

### Example Code Snippet

```python
from prob_failure.statistical_methods.monte_carlo import MonteCarloSimulation
import numpy as np

# 1. Define your model
def my_stress_model(force, area):
    return force / area

# 2. Setup Simulation
mc = MonteCarloSimulation(my_stress_model)
mc.add_input('force', 'normal', loc=1000, scale=100)
mc.add_input('area', 'normal', loc=0.01, scale=0.001)

# 3. Run
results = mc.run()
print(f"Mean Stress: {np.mean(results)} Pa")
```

## Project Structure

*   `prob_failure/`: Main package directory.
    *   `formulas/`: Engineering formulas for different components.
    *   `statistical_methods/`: Monte Carlo and sensitivity analysis logic.
    *   `plotting/`: Visualization utilities.
*   `demo.py`: Example usage script.
paralex 2.2.16
Standard for lexicons of inflected paradigms
Requires Python: >=3.9

# Paralex: lexicons of morphological paradigms

[Paralex](https://www.paralex-standard.org) is a standard for morphological lexicons which document inflectional paradigms.

This package contains:
- The paralex specification
- The full documentation
- Utilities to generate metadata and to validate paralex lexicons

# Generating metadata

To generate paralex metadata (more in the docs):


```python title="gen-metadata.py"
from paralex import paralex_factory

package = paralex_factory("Vulcan Verbal Paradigms",
                          {
                              "forms": {"path": "vulcan_v_forms.csv"},
                          }
                          )
package.to_json("vulcan.package.json")
```

The package returned is a [frictionless Package object](https://framework.frictionlessdata.io/docs/framework/package.html) and can be manipulated as such as needed.


# Validation of paralex datasets

To validate a paralex lexicon:

~~~
    paralex validate <mypackagename>.package.json
~~~

This checks that the data is valid using frictionless, as well as a number of statements to match the paralex standard.
For a detailed report on frictionless metadata, do:


~~~
    frictionless validate <mypackagename>.package.json
~~~

# Accessing datasets

Available datasets in the Zenodo community:

~~~
    paralex list
~~~

Download a dataset and extract the .zip archive:

~~~
    paralex get <ZENODO_ID>
~~~

The Zenodo ID can be found with the `paralex list` command.

# Serving the paralex site

First, build the standard package from files:

~~~
	paralex make_standard
~~~

Second, build the specs files from the standard package:

~~~
	paralex make_doc
~~~

Third, use mkdocs (which needs to be installed) to build this site:

~~~
	mkdocs serve
~~~