Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CADET-RDM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IBG-1
ModSim
CADET
CADET-RDM
Commits
b5d89fa9
Commit
b5d89fa9
authored
1 year ago
by
Ronald Jäpel
Browse files
Options
Downloads
Patches
Plain Diff
Modify default kwargs based on internal testing
parent
01fc4aab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cadetrdm/initialize_repo.py
+4
-4
4 additions, 4 deletions
cadetrdm/initialize_repo.py
cadetrdm/utils.py
+14
-4
14 additions, 4 deletions
cadetrdm/utils.py
setup.cfg
+1
-1
1 addition, 1 deletion
setup.cfg
with
19 additions
and
9 deletions
cadetrdm/initialize_repo.py
+
4
−
4
View file @
b5d89fa9
...
@@ -55,13 +55,13 @@ def is_tool(name):
...
@@ -55,13 +55,13 @@ def is_tool(name):
@click.command
()
@click.command
()
@click.option
(
'
--output_repo_name
'
,
default
=
"
output
"
,
@click.option
(
'
--output_repo_name
'
,
default
=
"
output
"
,
help
=
'
Name of the folder where the tracked output should be stored.
'
)
help
=
'
Name of the folder where the tracked output should be stored.
Optional. Default:
"
output
"
.
'
)
@click.option
(
'
--gitignore
'
,
default
=
None
,
@click.option
(
'
--gitignore
'
,
default
=
None
,
help
=
'
List of files to be added to the gitignore file.
'
)
help
=
'
List of files to be added to the gitignore file.
Optional.
'
)
@click.option
(
'
--gitattributes
'
,
default
=
None
,
@click.option
(
'
--gitattributes
'
,
default
=
None
,
help
=
'
List of files to be added to the gitattributes file.
'
)
help
=
'
List of files to be added to the gitattributes file.
Optional.
'
)
@click.option
(
'
--lfs_filetypes
'
,
default
=
None
,
@click.option
(
'
--lfs_filetypes
'
,
default
=
None
,
help
=
'
List of filetypes to be handled by git lfs.
'
)
help
=
'
List of filetypes to be handled by git lfs.
Optional.
'
)
@click.argument
(
'
path_to_repo
'
)
@click.argument
(
'
path_to_repo
'
)
def
initialize_git_repo_cli
(
path_to_repo
:
str
,
output_repo_name
:
(
str
|
bool
)
=
"
output
"
,
gitignore
:
list
=
None
,
def
initialize_git_repo_cli
(
path_to_repo
:
str
,
output_repo_name
:
(
str
|
bool
)
=
"
output
"
,
gitignore
:
list
=
None
,
gitattributes
:
list
=
None
,
lfs_filetypes
:
list
=
None
,
gitattributes
:
list
=
None
,
lfs_filetypes
:
list
=
None
,
...
...
This diff is collapsed.
Click to expand it.
cadetrdm/utils.py
+
14
−
4
View file @
b5d89fa9
...
@@ -261,7 +261,8 @@ class BaseRepo:
...
@@ -261,7 +261,8 @@ class BaseRepo:
class
ProjectRepo
(
BaseRepo
):
class
ProjectRepo
(
BaseRepo
):
def
__init__
(
self
,
repository_path
=
None
,
output_folder
=
None
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
repository_path
=
None
,
output_folder
=
None
,
search_parent_directories
=
True
,
*
args
,
**
kwargs
):
"""
"""
Class for Project-Repositories. Handles interaction between the project repo and
Class for Project-Repositories. Handles interaction between the project repo and
the output (i.e. results) repo.
the output (i.e. results) repo.
...
@@ -270,13 +271,18 @@ class ProjectRepo(BaseRepo):
...
@@ -270,13 +271,18 @@ class ProjectRepo(BaseRepo):
Path to the root of the git repository.
Path to the root of the git repository.
:param output_folder:
:param output_folder:
Path to the root of the output repository.
Path to the root of the output repository.
:param search_parent_directories:
if True, all parent directories will be searched for a valid repo as well.
Please note that this was the default behaviour in older versions of GitPython,
which is considered a bug though.
:param args:
:param args:
Additional args to be handed to BaseRepo.
Additional args to be handed to BaseRepo.
:param kwargs:
:param kwargs:
Additional kwargs to be handed to BaseRepo.
Additional kwargs to be handed to BaseRepo.
"""
"""
super
().
__init__
(
repository_path
,
*
args
,
**
kwargs
)
super
().
__init__
(
repository_path
,
search_parent_directories
=
search_parent_directories
,
*
args
,
**
kwargs
)
if
output_folder
is
not
None
:
if
output_folder
is
not
None
:
self
.
_output_folder
=
output_folder
self
.
_output_folder
=
output_folder
...
@@ -475,13 +481,17 @@ class ProjectRepo(BaseRepo):
...
@@ -475,13 +481,17 @@ class ProjectRepo(BaseRepo):
self
.
remove_cached_files
()
self
.
remove_cached_files
()
@contextlib.contextmanager
@contextlib.contextmanager
def
track_results
(
self
,
results_commit_message
:
str
):
def
track_results
(
self
,
results_commit_message
:
str
,
debug
=
False
):
"""
"""
Context manager to be used when runn
n
ing project code that produces output that should
Context manager to be used when running project code that produces output that should
be tracked in the output repository.
be tracked in the output repository.
:param results_commit_message:
:param results_commit_message:
Commit message for the commit of the output repository.
Commit message for the commit of the output repository.
"""
"""
if
debug
:
yield
"
debug
"
return
new_branch_name
=
self
.
enter_context
()
new_branch_name
=
self
.
enter_context
()
try
:
try
:
yield
new_branch_name
yield
new_branch_name
...
...
This diff is collapsed.
Click to expand it.
setup.cfg
+
1
−
1
View file @
b5d89fa9
[metadata]
[metadata]
name
=
modsimdata
name
=
CADETRDM
version
=
0.1.0
version
=
0.1.0
author
=
Ronald Jäpel
author
=
Ronald Jäpel
author_email
=
r.jaepel@fz-juelich.de
author_email
=
r.jaepel@fz-juelich.de
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment