Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/harshsahu23/wabtec3_brakesgui_shared

💻 App to visualize error logs and dump files generated by the braking system of locomotives 🚅
https://github.com/harshsahu23/wabtec3_brakesgui_shared

csv data-visualization graphs pandas plotly python streamlit visualization

Last synced: 5 days ago
JSON representation

💻 App to visualize error logs and dump files generated by the braking system of locomotives 🚅

Awesome Lists containing this project

README

        

# Error Analyzer 📊


Wabtec

> A Python-based application for analyzing error codes from CSV files with interactive visualizations.

## Features ✨

- Interactive GUI built with Streamlit
- Real-time error code analysis
- Dynamic visualization using Plotly
- CSV file processing and management
- Comprehensive error frequency reporting

## Installation 🚀

### Prerequisites

- Python 3.8+
- Git

### Quick Start

1. Clone the repository:
```bash
git clone https://github.com/HarshSahu23/Wabtec3_BrakesGUI_shared.git
cd Wabtec3_BrakesGUI_shared
```

2. Set up virtual environment:
```bash
python -m venv venv

# Windows
.\venv\Scripts\activate

# Unix/MacOS
source venv/bin/activate
```

3. Install dependencies:
```bash
pip install -r requirements.txt
```

## Project Structure 📁

```
.
├── assets # App/Repo related assets here.
├── build_scripts # Folder for Build related scripts.
│   ├── build_exe.py -> Script to generate exec.
│   ├── exclude_modules.py -> List of modules to be excluded.
│   └── main.spec -> Specifications that can be used with pyinstaller.
├── csv # CSV files for testing purposes.
├── instructions.md # Contains general instructions about project (to be merged with README).
├── readme.md # Project instructions.
├── requirements.txt # Required Python packages list.
└── src # Containes the source code.
   ├── backend -> Code for backend and data processing.
   │   ├── data_extractor ->> Code for Data extraction.
   │   │   ├── dataframe_classifier.py - Identifies the type of log being processed.
   │   │   └── dataframe_extractor.py - Extracts the CSV data as a dataframe.
   │   ├── data_handler.py ->> Code common interface that exposes all the backend functionality to frontend.
   │   ├── data_processors ->> Code for analytical processing and data formatting.
   │   │   ├── detailed_data_for_error_grouper.py - Generate custom dataframe table to obtain detailed data.
   │   │   ├── dmp_processor.py - Dump file procesing and formatting.
   │   │   ├── ecl_processor.py - Error log processor.
   │   │   ├── error_grouper_for_error_log_tab.py - Error group generator for error log tab in UI.
   │   │   └── table_maker_for_summary_tab.py - Table maker for summary tab in UI.
   │   ├── json_config_loader.py ->> Loads JSON config from the directory.
   │   ├── plotter.py ->> Plotting functions for the use in CLI.
   │   └── utils ->> Utility code.
   │   ├── exceptions.py - Custom exception class code.
   │   ├── folder_validator.py - Folder path validator.
   │   └── logging_config.py - Logging config file.
   ├── backup_config.json -> Backup config JSON in case some corruption of original happens.
   ├── config.json -> Config file for the app.
   ├── frontend -> Frontend code Part.
   │   ├── cmd_toolset.py ->> Code for cmd toolset.
   │   ├── compute ->> Computes various charting elements.
   │   │   ├── calculate_percentages.py - Annotaions on the chart.
   │   │   ├── summary_viz.py - Chart for the summary tab.
   │   │   ├── update_chart.py - Updates chart when specific button clicked in error log tab.
   │   │   └── visualizations.py - Charts for the error log tab.
   │   ├── gui.py ->> Main GUI entrypoint.
   │   ├── tabs ->> Contains GUI code for different tabs.
   │   └── utils ->> Utility functions for various widgets.
   │   ├── create_tab_labels.py - CSS designs for labeling.
   │   ├── css_utils.py - CSS designs for error log tab.
   │   ├── edit_folder_metadata.py - Widget for editing Coach and depot data
   │   ├── render_section_header.py - CSS for section header.
   │   ├── render_sidebar.py - Display custom sidebar.
   │   └── sidebar_utils.py - Widgets displayed inside sidebar.
   ├── main.py -> Main entry code for the app.
   └── tester.ipynb -> Tester python notebook to test the new functions.
```

## Usage 💡

1. Launch the application:
```bash
python main.py
```

2. Process error logs:
- Place CSV files in the `csv/` directory
- Input expected error descriptions
- View analysis results and visualizations

OR

## Use the GUI 💻

### A) Browse Files to upload :



Screenshot 1

### B) Select files to upload :



Screenshot 2

### C) Select/Search various errors


Screenshot 3



### D) Use dashboard to view charts & interact with them:


Screenshot 4

### E) View various charts:



Screenshot 5


Screenshot 5_1


Screenshot 5_2

### F) Get Detailed Data of any selected errors, apply filters


Screenshot 6
Screenshot 7

### G) View Dump Log



screenshot 8

### H) Detailed Data for Dump Files


screenshot 9

## Development 🛠️

### Code Style

- Follow [PEP 8](https://www.python.org/dev/peps/pep-0008/) guidelines
- Use descriptive variable and function names
- Include docstrings and comments where appropriate

### Testing

```bash
# Run tests
python -m pytest tests/

# Check code coverage
python -m pytest --cov=src tests/
```

## Contributing 🤝

1. Fork the repository
2. Create a feature branch:
```bash
git checkout -b feature/amazing-feature
```

3. Commit your changes:
```bash
git commit -m 'Add amazing feature'
```

4. Push to your branch:
```bash
git push origin feature/amazing-feature
```

5. Open a Pull Request

### Contribution Guidelines

- Write clear commit messages
- Include tests for new features
- Update documentation as needed
- Submit PRs to the `develop` branch

## License 📝

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---


Made with ❤️ by Team ^_^ - Exceed 3.0