Skip to content

Commit

Permalink
Merge branch 'main' into rework_ingest_spectrum
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-rodriguez authored Jun 14, 2024
2 parents 27ec229 + 593019b commit ad1db8d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 93 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"forwardPorts": [5432],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip install astrodbkit2 pytest psycopg2 ads git+https://github.com/astrodbtoolkit/astrodb_utils.git@main",
"postCreateCommand": "pip install -r requirements.txt",
// python scripts/tutorials/generate_database.py sqlite
// python scripts/tutorials/generate_database.py postgres postgres://postgres@localhost:5432

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest ads matplotlib
pip install astrodbkit2
pip install git+https://github.com/astrodbtoolkit/astrodb_utils.git@main
pip install -r requirements.txt
- name: Test with pytest
run: |
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/scheduled-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest ads
pip install astrodbkit2
pip install git+https://github.com/astrodbtoolkit/astrodb_utils.git@main
pip install -r requirements.txt
- name: Test with pytest
run: |
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ If you'd like to set up your own copy of the SIMPLE database, here's what we rec
1. Clone or download a copy of this repo locally onto your computer.

2. Set up an environment for the Python code and install dependencies.
A conda environment file `environment.yml` exists for convenience. The following commands will use that file to create and activate an
environment called `simple-db`:

We recommend using a conda environment to handle python dependencies. The following commands will use that file to create and activate an
environment called `simple-db`. Run these commands at the terminal command prompt
```bash
conda env create -f environment.yml
conda create -n "simple-db" python=3.10
conda activate simple-db
pip install -r requirements.txt
```

3. In Python, connect a database file `SIMPLE.sqlite` as a Database object called `db` and recreate the database using the JSON files in the `data/` directory.

3. In Python, connect a database file `SIMPLE.sqlite` as a Database object called `db` and recreate the database using the JSON files in the `data/` directory. Run these commands from within Python.
```python
from astrodb_utils import load_astrodb
from simple.schema import *
Expand All @@ -49,15 +48,16 @@ A conda environment file `environment.yml` exists for convenience. The following
4. Use `astrodbkit2` to [explore](https://astrodbkit2.readthedocs.io/en/latest/#exploring-the-schema), [query](https://astrodbkit2.readthedocs.io/en/latest/#querying-the-database), and/or [modify](https://astrodbkit2.readthedocs.io/en/latest/#modifying-data) the database.
For example:
- Find all objects in the database with "0141" in the name
```
```python
db.search_object('0141', fmt='astropy')
```

- See all the data in the database for 2MASS J01415823-4633574

```
```python
db.inventory('2MASS J01415823-4633574', pretty_print=True)
```

5. The database can also be modified using helper scripts found in [`simple/utils`](simple/utils) and in the [`astrodb_utils`](https://github.com/astrodbtoolkit/astrodb_utils) package. Previously used scripts to modify and/or update the database are stored in the [`scripts/`](scripts) directory and can be used for inspiration.

## Contributor Instructions
Expand Down
78 changes: 0 additions & 78 deletions environment.yml

This file was deleted.

5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pytest
ads
matplotlib
astrodbkit2
git+https://github.com/astrodbtoolkit/astrodb_utils.git@main

0 comments on commit ad1db8d

Please sign in to comment.