Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GeoPhys
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
Releases
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ghsc
National Seismic Hazard Model Project
National Crustal Model
GeoPhys
Commits
894ba9b9
Commit
894ba9b9
authored
4 years ago
by
Clayton, Brandon Scott
Browse files
Options
Downloads
Patches
Plain Diff
add check, update readme
parent
516c2a7d
No related branches found
No related tags found
1 merge request
!4
Database
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
geophys/README.md
+45
-7
45 additions, 7 deletions
geophys/README.md
geophys/geo_phys_wrapper.py
+3
-0
3 additions, 0 deletions
geophys/geo_phys_wrapper.py
with
48 additions
and
7 deletions
geophys/README.md
+
45
−
7
View file @
894ba9b9
...
...
@@ -26,17 +26,45 @@ See [Poetry installation](https://python-poetry.org/docs/) instructions for more
pip
install
--user
poetry
```
#### Poetry Version
Ensure you are running Poetry version 1.0 with:
## Usage
### Install Dependenices
```
bash
poetry
self update 1
poetry
install
```
## Usage
### Install GeoPhys Database
The following will install the GeoPhys database only:
```
bash
poetry run database
--GeoPhys
```
### Install Dependenices and D
atabase
To download all d
atabase
s:
```
bash
poetry run setup
poetry run database
```
The output directory for the database can be specified using the
`--output`
argument:
```
bash
poetry run database
--output
=
"/path/to/database"
# Example
poetry run database
--output
=
"~/NCM_DATA"
```
The output directory can additionally be specified using the environmental variable
`NCM_DATABASE_PATH`
:
```
bash
export
NCM_DATABASE_PATH
=
"/path/to/database"
# Example
export
NCM_DATABASE_PATH
=
"~/NCM_DATA"
```
### Remove Database
To remove database directory:
```
bash
poetry run database
--clean
```
### Examples
...
...
@@ -69,7 +97,17 @@ The GeoPhys project contains githooks on pre-commit and pre-push that
will check the Python code format using
[
Black
](
https://github.com/psf/black
)
,
check the import sorting using
[
isort
](
https://github.com/timothycrosley/isort
)
, and
lints the code using
[
Flake8
](
https://gitlab.com/pycqa/flake8
)
.
The GitHooks are configured when using the
`poetry run setup`
command.
The GitHooks are configured with:
```
poetry run setup
```
### Checking the Format
To check the format of the code against Black and isort run:
```
poetry run format_check
```
### Formatting the Code
To automatically format the code using Black and isort run:
...
...
This diff is collapsed.
Click to expand it.
geophys/geo_phys_wrapper.py
+
3
−
0
View file @
894ba9b9
...
...
@@ -6,6 +6,8 @@ import time
import
numpy
as
np
from
ncm_database
import
check_geo_phys_database
import
geophys.geo_phys
as
gp
...
...
@@ -83,6 +85,7 @@ parser.add_argument(
def
main
():
check_geo_phys_database
()
t1
=
time
.
time
()
args
=
parser
.
parse_args
()
...
...
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