-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnboundLocalError: cannot access local variable 'temp_dir' where it is not associated with a value #59
Comments
Hi @Yuvalmaster, is this repository private on both GitHub and GitLab? |
The gitlab project is indeed private, but the GitHub project I tried too is not private. I used one of my public repos |
Any more details on which GitHub project? I can take a look at the error. |
@Yuvalmaster What version are you running? Try running Here is the output of your repo from my machine. Heartbeat-Analysis-Tool---EM
|
Feature | Description | |
---|---|---|
⚙️ | Architecture | The project follows a modular architecture, where different components are organized and separated according to their functionality. It uses the Model-View-Controller (MVC) design pattern. |
📄 | Documentation | The codebase lacks documentation, making it difficult for new developers to understand its implementation and usage. Additional documentation should be provided to improve comprehension and maintainability of the project. |
🔗 | Dependencies | The project relies on external libraries such as Flask, NumPy, and Pandas. Flask is used for the web framework, while NumPy and Pandas are used for data manipulation and analysis. |
🧩 | Modularity | The codebase is organized into several modules and packages, separating different functionalities. However, there is room for improvement in terms of further breaking down interdependent components into smaller, interchangeable modules. |
🧪 | Testing | The codebase currently lacks a comprehensive testing strategy. It would benefit from the implementation of unit tests, integration tests, and automated testing tools like Pytest or Selenium. Proper testing coverage would improve reliability and help catch potential issues or bugs. |
⚡️ | Performance | The codebase performance largely depends on the data size and the underlying hardware infrastructure. Proper optimization techniques like caching, efficient algorithms, and database indexing can be applied to enhance the system's speed, efficiency, and resource utilization. |
🔐 | Security | The codebase does not feature explicit security measures, such as input validation, authentication, or authorization mechanisms. Implementing security measures like secure user authentication and secure data handling would enhance the overall security of the system. |
🔀 | Version Control | Version control is implemented using Git, allowing developers to manage and track changes effectively. |
🔌 | Integrations | The project integrates with external services or APIs to collect and analyze heartbeat data. Further integration possibilities include data visualization libraries or tools to enhance data presentation. |
📶 | Scalability | The system's scalability depends on factors like the underlying infrastructure and the efficiency of the implemented algorithms. To improve scalability, the project could consider techniques like asynchronous programming, horizontal scaling, and distributed storage for handling increased data volume. |
📂 Repository Structure
└── Heartbeat-Analysis-Tool---EM/
├── .gitignore
├── README.md
├── config/
│ ├── analysis_config.yaml
│ └── db_config_template.yaml
├── dashboard data/
│ └── EM-HR Monitoring-rev0.3.json
├── data/
│ ├── DAVIDHAMELECH_1111_2023-07-02csv.csv
│ ├── HPhire_1111_2023-07-02csv.csv
│ ├── HPhire_1111_2023-07-03csv.csv
│ ├── HSet_1234_2023-07-01csv.csv
│ ├── HSet_1234_2023-07-02.csv
│ ├── HSet_1234_2023-07-03csv.csv
│ ├── Hi_IwillFail.csv
│ ├── Hset_2345_2023-07-02csv.csv
│ └── New Text Document.txt
├── requirements.txt
├── run.bat
└── src/
├── analysis.py
├── data_loader.py
├── database.py
├── log_parser.py
├── main.py
└── setup.py
⚙️ Modules
Root
File | Summary |
---|---|
requirements.txt | The requirements.txt file lists the necessary packages and their versions required for the code to run. It includes numpy, pandas, psycopg2, PyYAML, tqdm, and SQLAlchemy. These packages provide functionalities for data manipulation, SQL database connectivity, and progress tracking. |
run.bat | The code in the run.bat file executes the main.py script using Python, which is located in the src directory. |
Config
File | Summary |
---|---|
db_config_template.yaml | The code defines the configuration for a PostgreSQL database connection, including the host, port, database name, username, password (with a placeholder), schema, and table names. |
analysis_config.yaml | The code reads configuration data from a YAML file. It stores heart rate parameters, start and end codes, measurement code, total beats code, capacity, sample length, and time delta values. These values are used for further analysis or processing. |
Src
File | Summary |
---|---|
analysis.py | HTTPStatus Exception: 400 |
database.py | The code provides a Database class with functionalities for connecting to a PostgreSQL database, saving raw data and analysis data to the database, querying the database, and managing database tables. It also includes utilities for checking file existence, creating tables, and loading data for analysis. |
data_loader.py | The code in data_loader.py is responsible for loading CSV files, saving raw data to a database, and running analysis for each device in the database. It also checks the last primary ID for specified end codes in the log data. |
setup.py | This code is used to check and install all dependencies specified in a requirements file. It utilizes the subprocess module to run the pip install command and handles any errors that may occur during the installation process. |
main.py | The code in the main.py file sets up the project directories, installs required packages, loads raw data to a database, and runs analysis on the data for all devices. Finally, it closes the database connection. |
log_parser.py | This code defines a LogParser class with a static method that loads and extracts information from a log file. It validates the file format, extracts device type, device ID, and date from the file name, reads the file, converts time columns to datetime format, and returns the extracted data as a dictionary. |
🚀 Getting Started
Dependencies
Please ensure you have the following dependencies installed on your system:
- ℹ️ Dependency 1
- ℹ️ Dependency 2
- ℹ️ ...
🔧 Installation
- Clone the Heartbeat-Analysis-Tool---EM repository:
git clone https://github.com/Yuvalmaster/Heartbeat-Analysis-Tool---EM
- Change to the project directory:
cd Heartbeat-Analysis-Tool---EM
- Install the dependencies:
pip install -r requirements.txt
🤖 Running Heartbeat-Analysis-Tool---EM
python main.py
🧪 Tests
pytest
🛣 Roadmap
ℹ️ Task 1: Implement X
ℹ️ Task 2: Implement Y
ℹ️ ...
🤝 Contributing
Contributions are always welcome! Please follow these steps:
- Fork the project repository. This creates a copy of the project on your account that you can modify without affecting the original project.
- Clone the forked repository to your local machine using a Git client like Git or GitHub Desktop.
- Create a new branch with a descriptive name (e.g.,
new-feature-branch
orbugfix-issue-123
).
git checkout -b new-feature-branch
- Make changes to the project's codebase.
- Commit your changes to your local branch with a clear commit message that explains the changes you've made.
git commit -m 'Implemented new feature.'
- Push your changes to your forked repository on GitHub using the following command
git push origin new-feature-branch
- Create a new pull request to the original project repository. In the pull request, describe the changes you've made and why they're necessary.
The project maintainers will review your changes and provide feedback or merge them into the main branch.
📄 License
This project is licensed under the ℹ️ LICENSE-TYPE
License. See the LICENSE-Type file for additional info.
👏 Acknowledgments
- ℹ️ List any resources, contributors, inspiration, etc.
I did upgrade but no luck. Still have the same error The above exception was the direct cause of the following exception: Traceback (most recent call last): Traceback (most recent call last): |
@Yuvalmaster Just made a small update.
Let me know if that changes anything. |
No luck yet |
Hi @Yuvalmaster, can you try once more with pip install readmeai==0.4.6 If this does not work, I'll boot up a windows machine when I get a chance and do some further debugging. Theres also a possibility that it could be a permissions issue on your machine. Let me know what happens and we'll go from there.
|
I'm here just to confirm that this issue still exists on my Windows machine, with the latest version installed. EDIT: shutil.rmtree(item) # at line 100 of file `readmeai/services/git.py` with something else that does the same: os.system('rmdir /S /Q "{}"'.format(item.absolute())) Note that it's only a temporary workaround and I hope the creator will fix it someday. |
Hello, Thanks to @minhcrafters the problem is fixed. |
Hi,
I'm trying to run the readme-ai on both a github and gitlab repos without any succsess.
I am using python 3.11.4 using conda as venv (tried also with other venvs).
I've installed using
pip install readmeai
this is the error I get:
The text was updated successfully, but these errors were encountered: