Skip to content

Commit

Permalink
Updated NGL documentation (#52)
Browse files Browse the repository at this point in the history
* Add files via upload

* Delete docs/brandenberg/apiusecases/output_9_1.png

* Delete docs/brandenberg/apiusecases/output_11_1.png

* Delete docs/brandenberg/apiusecases/output_7_1.png

* Delete docs/brandenberg/apiusecases/output_8_0.png

* Update usecase.md

* Update usecase.md

* Create license.md

* Update usecase.md

Adjusting heading levels for use cases so they fall under "Implementation"

* Update usecase.md

* Update usecase.md

* Update usecase.md

* Update usecase.md

* Update usecase.md

* Update usecase.md

* Update usecase.md

* Update usecase.md

Updating hyperlinks and adding table with links to notebooks

* Update usecase.md

* Update usecase.md

* Update usecase.md

* Update usecase.md

* Update usecase.md

* Update usecase.md

---------

Co-authored-by: Krishna Kumar <[email protected]>
  • Loading branch information
sjbrandenberg and kks32 authored Nov 26, 2023
1 parent 7bc4001 commit c8be696
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions docs/brandenberg/usecase.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ The example makes use of the following DesignSafe resources:
</tr>
<tr>
<td>
Direct Simple Shear Viewer
Laboratory Test Viewer
</td>
<td>
<a href="https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/NGL/DSS_Viewer.ipynb" target="_blank"><img src="https://raw.githubusercontent.com/geoelements/LearnMPM/main/DesignSafe-Badge.svg"></a>
<a href="https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/NGL/LabTestViewer.ipynb" target="_blank"><img src="https://raw.githubusercontent.com/geoelements/LearnMPM/main/DesignSafe-Badge.svg"></a>
</td>
</tr>
</table>
Expand Down Expand Up @@ -109,11 +109,18 @@ This documentation first demonstrates how to install the database connection scr
## Installing Database Connection Script

Connecting to a relational database requires credentials, like username, password, database name, and hostname.
Rather than requiring users to know these credentials and create their own database connections, we have created a Python package that allows users to
query the database. This code installs the package containing the database connection script for NGL:
Rather than requiring users to know these credentials and create their own database connections, we have created a Python package that allows users to query the database. This code installs the package containing the database connection script for NGL:

```python
!pip install git+https://github.com/sjbrandenberg/designsafe_db
!pip install dsdatabase
```

The connection script can then be invoked by creating an object from the DSDatabase class corresponding to the "ngl" connection, and submitting a query using the ngl.read_sql(sql) function.

```python
from dsdatabase.db import DSDatabase
ngl = DSDatabase("ngl")
df = ngl.read_sql(sql)
```

## Example Queries
Expand Down

0 comments on commit c8be696

Please sign in to comment.