Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pycgtool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
James Graham
pycgtool
Commits
f3660f70
Verified
Commit
f3660f70
authored
3 years ago
by
James Graham
Browse files
Options
Downloads
Patches
Plain Diff
feat: add flag to get version number
parent
d23c2c85
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pycgtool/__main__.py
+5
-0
5 additions, 0 deletions
pycgtool/__main__.py
tests/test_pycgtool.py
+7
-5
7 additions, 5 deletions
tests/test_pycgtool.py
with
12 additions
and
5 deletions
pycgtool/__main__.py
+
5
−
0
View file @
f3660f70
...
...
@@ -4,6 +4,7 @@ import argparse
import
cProfile
import
logging
import
pathlib
import
pkg_resources
import
sys
import
textwrap
import
time
...
...
@@ -143,10 +144,14 @@ class BooleanAction(argparse.Action):
def
parse_arguments
(
arg_list
):
# yapf: disable
parser
=
argparse
.
ArgumentParser
(
prog
=
'
pycgtool
'
,
formatter_class
=
argparse
.
ArgumentDefaultsHelpFormatter
,
description
=
"
Generate coarse-grained molecular dynamics models from atomistic trajectories.
"
)
parser
.
add_argument
(
'
-v
'
,
'
--version
'
,
action
=
'
version
'
,
version
=
pkg_resources
.
get_distribution
(
'
pycgtool
'
).
version
)
# Input files
input_files
=
parser
.
add_argument_group
(
"
input files
"
)
...
...
This diff is collapsed.
Click to expand it.
tests/test_pycgtool.py
+
7
−
5
View file @
f3660f70
...
...
@@ -42,11 +42,13 @@ class PycgtoolTest(unittest.TestCase):
base_dir
=
pathlib
.
Path
(
__file__
).
absolute
().
parent
data_dir
=
base_dir
.
joinpath
(
'
data
'
)
def
test_run_help
(
self
):
self
.
assertEqual
(
0
,
subprocess
.
check_call
([
"
python
"
,
"
-m
"
,
"
pycgtool
"
,
"
-h
"
],
stdout
=
subprocess
.
PIPE
))
def
test_pycgtool_help
(
self
):
subprocess
.
check_call
([
"
python
"
,
"
-m
"
,
"
pycgtool
"
,
"
-h
"
])
subprocess
.
check_call
([
"
python
"
,
"
-m
"
,
"
pycgtool
"
,
"
--help
"
])
def
test_pycgtool_version
(
self
):
subprocess
.
check_call
([
'
python
'
,
'
-m
'
,
'
pycgtool
'
,
'
-v
'
])
subprocess
.
check_call
([
'
python
'
,
'
-m
'
,
'
pycgtool
'
,
'
--version
'
])
def
test_parse_arguments
(
self
):
args
=
main
.
parse_arguments
([
...
...
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