-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from Munsif-Raza-T/main
Notebook Application and BMI Calculator added as Contribution
- Loading branch information
Showing
22 changed files
with
7,245 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
WareHouse/BMI Calculator_DefaultOrganization_20230918110521/BMI Calculator.prompt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Build a BMI calculator application that will take necessary inputs and then will out the BMI |
2,742 changes: 2,742 additions & 0 deletions
2,742
..._DefaultOrganization_20230918110521/BMI Calculator_DefaultOrganization_20230918110521.log
Large diffs are not rendered by default.
Oops, something went wrong.
101 changes: 101 additions & 0 deletions
101
WareHouse/BMI Calculator_DefaultOrganization_20230918110521/ChatChainConfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
{ | ||
"chain": [ | ||
{ | ||
"phase": "DemandAnalysis", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": -1, | ||
"need_reflect": "True" | ||
}, | ||
{ | ||
"phase": "LanguageChoose", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": -1, | ||
"need_reflect": "True" | ||
}, | ||
{ | ||
"phase": "Coding", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": 1, | ||
"need_reflect": "False" | ||
}, | ||
{ | ||
"phase": "CodeCompleteAll", | ||
"phaseType": "ComposedPhase", | ||
"cycleNum": 10, | ||
"Composition": [ | ||
{ | ||
"phase": "CodeComplete", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": 1, | ||
"need_reflect": "False" | ||
} | ||
] | ||
}, | ||
{ | ||
"phase": "CodeReview", | ||
"phaseType": "ComposedPhase", | ||
"cycleNum": 3, | ||
"Composition": [ | ||
{ | ||
"phase": "CodeReviewComment", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": 1, | ||
"need_reflect": "False" | ||
}, | ||
{ | ||
"phase": "CodeReviewModification", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": 1, | ||
"need_reflect": "False" | ||
} | ||
] | ||
}, | ||
{ | ||
"phase": "Test", | ||
"phaseType": "ComposedPhase", | ||
"cycleNum": 3, | ||
"Composition": [ | ||
{ | ||
"phase": "TestErrorSummary", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": 1, | ||
"need_reflect": "False" | ||
}, | ||
{ | ||
"phase": "TestModification", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": 1, | ||
"need_reflect": "False" | ||
} | ||
] | ||
}, | ||
{ | ||
"phase": "EnvironmentDoc", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": 1, | ||
"need_reflect": "True" | ||
}, | ||
{ | ||
"phase": "Manual", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": 1, | ||
"need_reflect": "False" | ||
} | ||
], | ||
"recruitments": [ | ||
"Chief Executive Officer", | ||
"Counselor", | ||
"Chief Human Resource Officer", | ||
"Chief Product Officer", | ||
"Chief Technology Officer", | ||
"Programmer", | ||
"Code Reviewer", | ||
"Software Test Engineer", | ||
"Chief Creative Officer" | ||
], | ||
"clear_structure": "True", | ||
"brainstorming": "False", | ||
"gui_design": "True", | ||
"git_management": "False", | ||
"self_improve": "False" | ||
} |
301 changes: 301 additions & 0 deletions
301
WareHouse/BMI Calculator_DefaultOrganization_20230918110521/PhaseConfig.json
Large diffs are not rendered by default.
Oops, something went wrong.
65 changes: 65 additions & 0 deletions
65
WareHouse/BMI Calculator_DefaultOrganization_20230918110521/RoleConfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"Chief Executive Officer": [ | ||
"{chatdev_prompt}", | ||
"You are Chief Executive Officer. Now, we are both working at ChatDev and we share a common interest in collaborating to successfully complete a task assigned by a new customer.", | ||
"Your main responsibilities include being an active decision-maker on users' demands and other key policy issues, leader, manager, and executor. Your decision-making role involves high-level decisions about policy and strategy; and your communicator role can involve speaking to the organization's management and employees.", | ||
"Here is a new customer's task: {task}.", | ||
"To complete the task, I will give you one or more instructions, and you must help me to write a specific solution that appropriately solves the requested instruction based on your expertise and my needs." | ||
], | ||
"Chief Product Officer": [ | ||
"{chatdev_prompt}", | ||
"You are Chief Product Officer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.", | ||
"You are responsible for all product-related matters in ChatDev. Usually includes product design, product strategy, product vision, product innovation, project management and product marketing.", | ||
"Here is a new customer's task: {task}.", | ||
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs." | ||
], | ||
"Counselor": [ | ||
"{chatdev_prompt}", | ||
"You are Counselor. Now, we share a common interest in collaborating to successfully complete a task assigned by a new customer.", | ||
"Your main responsibilities include asking what user and customer think and provide your valuable suggestions. ", | ||
"Here is a new customer's task: {task}.", | ||
"To complete the task, I will give you one or more instructions, and you must help me to write a specific solution that appropriately solves the requested instruction based on your expertise and my needs." | ||
], | ||
"Chief Technology Officer": [ | ||
"{chatdev_prompt}", | ||
"You are Chief Technology Officer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.", | ||
"You are very familiar to information technology. You will make high-level decisions for the overarching technology infrastructure that closely align with the organization's goals, while you work alongside the organization's information technology (\"IT\") staff members to perform everyday operations.", | ||
"Here is a new customer's task: {task}.", | ||
"To complete the task, You must write a response that appropriately solves the requested instruction based on your expertise and customer's needs." | ||
], | ||
"Chief Human Resource Officer": [ | ||
"{chatdev_prompt}", | ||
"You are Chief Human Resource Officer. Now, we are both working at ChatDev and we share a common interest in collaborating to successfully complete a task assigned by a new customer.", | ||
"You are a corporate officer who oversees all aspects of human resource management and industrial relations policies, practices and operations for an organization. You will be involved in board staff recruitment, member selection, executive compensation, and succession planning. Besides, You report directly to the chief executive officer (CEO) and am a member of the most senior-level committees of a company (e.g., executive committee or office of CEO).", | ||
"Here is a new customer's task: {task}.", | ||
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs." | ||
], | ||
"Programmer": [ | ||
"{chatdev_prompt}", | ||
"You are Programmer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.", | ||
"You can write/create computer software or applications by providing a specific programming language to the computer. You have extensive computing and coding experience in many varieties of programming languages and platforms, such as Python, Java, C, C++, HTML, CSS, JavaScript, XML, SQL, PHP, etc,.", | ||
"Here is a new customer's task: {task}.", | ||
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs." | ||
], | ||
"Code Reviewer": [ | ||
"{chatdev_prompt}", | ||
"You are Code Reviewer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.", | ||
"You can help programmers to assess source codes for software troubleshooting, fix bugs to increase code quality and robustness, and offer proposals to improve the source codes.", | ||
"Here is a new customer's task: {task}.", | ||
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs." | ||
], | ||
"Software Test Engineer": [ | ||
"{chatdev_prompt}", | ||
"You are Software Test Engineer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.", | ||
"You can use the software as intended to analyze its functional properties, design manual and automated test procedures to evaluate each software product, build and implement software evaluation test programs, and run test programs to ensure that testing protocols evaluate the software correctly.", | ||
"Here is a new customer's task: {task}.", | ||
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs." | ||
], | ||
"Chief Creative Officer": [ | ||
"{chatdev_prompt}", | ||
"You are Chief Creative Officer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.", | ||
"You direct ChatDev's creative software's and develop the artistic design strategy that defines the company's brand. You create the unique image or music of our produced software's and deliver this distinctive design to consumers to create a clear brand image which is a fundamental and essential work throughout the company.", | ||
"Here is a new customer's task: {task}.", | ||
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs." | ||
] | ||
} |
9 changes: 9 additions & 0 deletions
9
WareHouse/BMI Calculator_DefaultOrganization_20230918110521/bmi_calculator.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
''' | ||
This file contains the BMICalculator class. | ||
''' | ||
class BMICalculator: | ||
def calculate_bmi(self, weight, height): | ||
if height <= 0: | ||
raise ValueError("Height cannot be zero or negative.") | ||
bmi = weight / (height ** 2) | ||
return bmi |
36 changes: 36 additions & 0 deletions
36
WareHouse/BMI Calculator_DefaultOrganization_20230918110521/main.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
''' | ||
This is the main file of the BMI calculator application. | ||
''' | ||
import tkinter as tk | ||
from bmi_calculator import BMICalculator | ||
class BMIApplication(tk.Tk): | ||
def __init__(self): | ||
super().__init__() | ||
self.title("BMI Calculator") | ||
self.geometry("300x200") | ||
self.bmi_calculator = BMICalculator() | ||
self.weight_label = tk.Label(self, text="Weight (kg):") | ||
self.weight_label.pack() | ||
self.weight_entry = tk.Entry(self) | ||
self.weight_entry.pack() | ||
self.height_label = tk.Label(self, text="Height (cm):") | ||
self.height_label.pack() | ||
self.height_entry = tk.Entry(self) | ||
self.height_entry.pack() | ||
self.calculate_button = tk.Button(self, text="Calculate", command=self.calculate_bmi) | ||
self.calculate_button.pack() | ||
self.result_label = tk.Label(self, text="") | ||
self.result_label.pack() | ||
def calculate_bmi(self): | ||
try: | ||
weight = float(self.weight_entry.get()) | ||
height = float(self.height_entry.get()) / 100 | ||
bmi = self.bmi_calculator.calculate_bmi(weight, height) | ||
self.result_label.config(text=f"BMI: {bmi:.2f}") | ||
except ValueError: | ||
self.result_label.config(text="Invalid input. Please enter numeric values for weight and height.") | ||
except ZeroDivisionError: | ||
self.result_label.config(text="Invalid input. Height cannot be zero.") | ||
if __name__ == "__main__": | ||
app = BMIApplication() | ||
app.mainloop() |
55 changes: 55 additions & 0 deletions
55
WareHouse/BMI Calculator_DefaultOrganization_20230918110521/manual.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# BMI Calculator Application User Manual | ||
|
||
## Introduction | ||
|
||
The BMI Calculator Application is a simple tool that allows users to calculate their Body Mass Index (BMI) based on their weight and height. This user manual provides detailed instructions on how to install the application and how to use it effectively. | ||
|
||
## Installation | ||
|
||
To install the BMI Calculator Application, please follow the steps below: | ||
|
||
1. Ensure that you have Python installed on your computer. If not, you can download and install Python from the official website: [https://www.python.org/downloads/](https://www.python.org/downloads/) | ||
|
||
2. Open a terminal or command prompt. | ||
|
||
3. Use the following command to install the necessary dependencies: | ||
|
||
``` | ||
pip install tkinter | ||
``` | ||
|
||
4. Download the `main.py` and `bmi_calculator.py` files from the provided code. | ||
|
||
5. Place the downloaded files in a directory of your choice. | ||
|
||
## Usage | ||
|
||
To use the BMI Calculator Application, please follow the steps below: | ||
|
||
1. Open a terminal or command prompt. | ||
|
||
2. Navigate to the directory where you placed the downloaded files. | ||
|
||
3. Run the following command to start the application: | ||
|
||
``` | ||
python main.py | ||
``` | ||
|
||
4. The BMI Calculator window will appear. | ||
|
||
5. Enter your weight in kilograms in the "Weight (kg)" field. | ||
|
||
6. Enter your height in centimeters in the "Height (cm)" field. | ||
|
||
7. Click the "Calculate" button. | ||
|
||
8. The calculated BMI will be displayed in the "BMI" field. | ||
|
||
**Note:** If you enter invalid input (non-numeric values or zero height), an error message will be displayed. | ||
|
||
9. You can repeat the process to calculate the BMI with different weight and height values. | ||
|
||
## Conclusion | ||
|
||
The BMI Calculator Application provides a convenient way to calculate your BMI based on your weight and height. By following the installation and usage instructions in this user manual, you can easily use the application to track your BMI and monitor your health. |
29 changes: 29 additions & 0 deletions
29
WareHouse/BMI Calculator_DefaultOrganization_20230918110521/meta.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Task: | ||
Build a BMI calculator application that will take necessary inputs and then will out the BMI | ||
|
||
Config: | ||
ChatEnvConfig.clear_structure: True | ||
ChatEnvConfig.brainstorming: False | ||
|
||
|
||
Roster: | ||
Chief Executive Officer, Counselor, Chief Human Resource Officer, Chief Product Officer, Chief Technology Officer, Programmer, Code Reviewer, Software Test Engineer, Chief Creative Officer | ||
|
||
Modality: | ||
application | ||
|
||
Ideas: | ||
|
||
|
||
Language: | ||
Python | ||
|
||
Code_Version: | ||
5.0 | ||
|
||
Proposed_images: | ||
0 | ||
|
||
Incorporated_images: | ||
0 | ||
|
6 changes: 6 additions & 0 deletions
6
WareHouse/Notebook Application_DefaultOrganization_20230918090434/.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from tkinter import filedialog | ||
def save_file(self): | ||
file_path = filedialog.asksaveasfilename(defaultextension=".txt", filetypes=[("Text Files", "*.txt")]) | ||
if file_path: | ||
with open(file_path, 'w') as file: | ||
file.write(self.text_area.get('1.0', 'end-1c')) |
Oops, something went wrong.