Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pycomsdk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
com
pycomsdk
Commits
67a91e11
Commit
67a91e11
authored
Jul 28, 2022
by
Anton Pershin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed config name to user-specific one
parent
a4d8f648
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
communication.py
comsdk/communication.py
+2
-2
edge.py
comsdk/edge.py
+1
-1
research.py
comsdk/research.py
+2
-2
No files found.
comsdk/communication.py
View file @
67a91e11
...
@@ -159,7 +159,7 @@ class LocalCommunication(BaseCommunication):
...
@@ -159,7 +159,7 @@ class LocalCommunication(BaseCommunication):
@classmethod
@classmethod
def
create_from_config
(
cls
):
def
create_from_config
(
cls
):
with
open
(
'config_research.json'
,
'r'
)
as
f
:
with
open
(
os
.
path
.
expanduser
(
'~/.comsdk/config_research.json'
)
,
'r'
)
as
f
:
conf
=
json
.
load
(
f
)
conf
=
json
.
load
(
f
)
local_host
=
Host
()
local_host
=
Host
()
_add_programs_and_commands_from_config
(
local_host
,
conf
[
'LOCAL_HOST'
])
_add_programs_and_commands_from_config
(
local_host
,
conf
[
'LOCAL_HOST'
])
...
@@ -212,7 +212,7 @@ class SshCommunication(BaseCommunication):
...
@@ -212,7 +212,7 @@ class SshCommunication(BaseCommunication):
@classmethod
@classmethod
def
create_from_config
(
cls
,
host_sid
):
def
create_from_config
(
cls
,
host_sid
):
with
open
(
'config_research.json'
,
'r'
)
as
f
:
with
open
(
os
.
path
.
expanduser
(
'~/.comsdk/config_research.json'
)
,
'r'
)
as
f
:
conf
=
json
.
load
(
f
)
conf
=
json
.
load
(
f
)
hostconf
=
conf
[
'REMOTE_HOSTS'
][
host_sid
]
hostconf
=
conf
[
'REMOTE_HOSTS'
][
host_sid
]
remote_host
=
RemoteHost
(
ssh_host
=
hostconf
[
'ssh_host'
],
remote_host
=
RemoteHost
(
ssh_host
=
hostconf
[
'ssh_host'
],
...
...
comsdk/edge.py
View file @
67a91e11
...
@@ -437,7 +437,7 @@ def build_args_line(data, keyword_names, flag_names, trailing_args_keys):
...
@@ -437,7 +437,7 @@ def build_args_line(data, keyword_names, flag_names, trailing_args_keys):
def
render_sge_template
(
sge_template_name
,
sge_script_path
,
cores
,
time
,
commands
):
def
render_sge_template
(
sge_template_name
,
sge_script_path
,
cores
,
time
,
commands
):
with
open
(
'config_research.json'
,
'r'
)
as
f
:
with
open
(
os
.
path
.
expanduser
(
'~/.comsdk/config_research.json'
)
,
'r'
)
as
f
:
conf
=
json
.
load
(
f
)
conf
=
json
.
load
(
f
)
sge_templ_path
=
os
.
path
.
join
(
conf
[
'TEMPLATES_PATH'
],
sge_template_name
)
sge_templ_path
=
os
.
path
.
join
(
conf
[
'TEMPLATES_PATH'
],
sge_template_name
)
if
not
os
.
path
.
exists
(
sge_templ_path
):
# by default, templates are in templates/, but here we let the user put any path
if
not
os
.
path
.
exists
(
sge_templ_path
):
# by default, templates are in templates/, but here we let the user put any path
...
...
comsdk/research.py
View file @
67a91e11
...
@@ -89,7 +89,7 @@ class Research:
...
@@ -89,7 +89,7 @@ class Research:
:param remote_comm: BaseCommunication instance used for communication with remote machine
:param remote_comm: BaseCommunication instance used for communication with remote machine
:return: new Research instance
:return: new Research instance
"""
"""
with
open
(
'config_research.json'
,
'r'
)
as
f
:
with
open
(
os
.
path
.
expanduser
(
'~/.comsdk/config_research.json'
)
,
'r'
)
as
f
:
conf
=
json
.
load
(
f
)
conf
=
json
.
load
(
f
)
res
=
Research
(
conf
[
'RESEARCH'
][
research_id
],
res
=
Research
(
conf
[
'RESEARCH'
][
research_id
],
continuing
=
True
,
continuing
=
True
,
...
@@ -109,7 +109,7 @@ class Research:
...
@@ -109,7 +109,7 @@ class Research:
:param remote_comm: BaseCommunication instance used for communication with remote machine
:param remote_comm: BaseCommunication instance used for communication with remote machine
:return: new Research instance
:return: new Research instance
"""
"""
with
open
(
'config_research.json'
,
'r+'
)
as
f
:
with
open
(
os
.
path
.
expanduser
(
'~/.comsdk/config_research.json'
)
,
'r+'
)
as
f
:
conf
=
json
.
load
(
f
)
conf
=
json
.
load
(
f
)
conf
[
'RESEARCH'
][
new_research_id
]
=
make_suitable_research_dir
(
new_research_descr
)
conf
[
'RESEARCH'
][
new_research_id
]
=
make_suitable_research_dir
(
new_research_descr
)
f
.
seek
(
0
)
f
.
seek
(
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment