Skip to content

Commit

Permalink
Merge pull request #238 from Aydinhamedi/Alpha-b
Browse files Browse the repository at this point in the history
Alpha b
  • Loading branch information
Aydinhamedi authored Apr 4, 2024
2 parents 7c59c89 + 422c30e commit 9ec545c
Show file tree
Hide file tree
Showing 8 changed files with 10,717 additions and 6,221 deletions.
2 changes: 1 addition & 1 deletion .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4,212 changes: 4,150 additions & 62 deletions BETA_E_Model_T&T.ipynb

Large diffs are not rendered by default.

12,640 changes: 6,490 additions & 6,150 deletions Model_T&T.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Utils/Other.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,4 @@ def print_optimizer_info(model):
for param, value in model.optimizer.get_config().items():
print_Color(f"~* <Opt> -- ~*{param}: ~*{value}", ["cyan", "light_cyan", "green"], advanced_mode=True)
else:
print_Color("No optimizer found in the model.", ["red"])
print_Color("No optimizer found in the model.", ["red"])
6 changes: 4 additions & 2 deletions Utils/Timeout_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import queue
import keyboard


class TimeoutInput:
"""
A class to get user input with a timeout.
Expand All @@ -24,9 +25,9 @@ def __init__(self, prompt, timeout, default_var, timeout_message="\nTimeout!"):

def get_input(self):
"""Get user input in a non-blocking manner."""
print(self.prompt, end='', flush=True)
print(self.prompt, end="", flush=True)
while not self.stop_thread:
if keyboard.is_pressed('\n'):
if keyboard.is_pressed("\n"):
line = input()
if line:
self.input_queue.put(line.strip())
Expand All @@ -50,6 +51,7 @@ def run(self):
self.user_input = self.input_queue.get()
return {"user_input": self.user_input, "input_time": self.timeout, "default_var_used": False}


# Example usage
if __name__ == "__main__":
timeout_input = TimeoutInput("Enter something: ", 5, "default", "\nTimeout from TimeoutInput!")
Expand Down
68 changes: 68 additions & 0 deletions archive_git_branch.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
@echo off
set /p branchName="Enter the branch name to archive: "

:: Check if the branch exists locally
git rev-parse --verify %branchName% >nul 2>&1
if errorlevel 1 (
echo The branch '%branchName%' does not exist locally.
echo Fetching the branch from the remote repository...
git fetch origin %branchName%:%branchName%
)

:: Check if the fetch was successful
git rev-parse --verify %branchName% >nul 2>&1
if errorlevel 1 (
echo Failed to fetch the branch '%branchName%'. Please check the branch name and try again.
exit /b
)

:: Archive the branch
set tagName=archive/%branchName%
git tag %tagName% %branchName%
git push origin %tagName%
echo Branch %branchName% has been archived as %tagName%.

:: Ask the user if they want to delete the branch
set /p deleteBranch="Do you want to delete the branch locally and remotely? (yes/no): "
if /i "%deleteBranch%"=="yes" (
git branch -d %branchName%
git push origin --delete %branchName%
echo Branch %branchName% has been deleted.
)

:: Suggest a filename for the batch file
set filename=archive_git_branch_%branchName%_%date:/=-%.bat
echo Suggested filename for this batch file is: %filename%
:: Filename: archive_git_branch.bat

@echo off
set /p branchName="Enter the branch name to archive: "

:: Check if the branch exists locally
git rev-parse --verify %branchName% >nul 2>&1
if errorlevel 1 (
echo The branch '%branchName%' does not exist locally.
echo Fetching the branch from the remote repository...
git fetch origin %branchName%:%branchName%
)

:: Check if the fetch was successful
git rev-parse --verify %branchName% >nul 2>&1
if errorlevel 1 (
echo Failed to fetch the branch '%branchName%'. Please check the branch name and try again.
exit /b
)

:: Archive the branch
set tagName=archive/%branchName%
git tag %tagName% %branchName%
git push origin %tagName%
echo Branch %branchName% has been archived as %tagName%.

:: Ask the user if they want to delete the branch
set /p deleteBranch="Do you want to delete the branch locally and remotely? (yes/no): "
if /i "%deleteBranch%"=="yes" (
git branch -d %branchName%
git push origin --delete %branchName%
echo Branch %branchName% has been deleted.
)
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ hyperas==0.4.1
imbalanced-learn==0.11.0
keras==2.10.0
keras-efficientnet-v2==1.2.2
keyboard==0.13.5
loguru==0.5.3
matplotlib==3.7.2
model-profiler==1.1.8
Expand Down

0 comments on commit 9ec545c

Please sign in to comment.