Skip to content

Commit

Permalink
Merge pull request #2832 from catalyst-cooperative/explode_forest_as_…
Browse files Browse the repository at this point in the history
…table

The ogr2ogr stuff is the only problem here. Merging to get this into my ongoing working FERC XBRL tree fixes.
  • Loading branch information
zaneselvans authored Sep 11, 2023
2 parents af6b6d0 + 1a2e444 commit 4cab17f
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 44 deletions.
41 changes: 25 additions & 16 deletions .github/workflows/tox-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,20 @@ jobs:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Install Conda environment using mamba
uses: mamba-org/provision-with-micromamba@v16
uses: mamba-org/setup-micromamba@v1
with:
environment-file: test/test-environment.yml
cache-env: true
channels: conda-forge,defaults
channel-priority: strict
cache-environment: true
condarc: |
channels:
- conda-forge
- defaults
channel_priority: strict
- name: Log environment details
run: |
Expand Down Expand Up @@ -68,17 +71,20 @@ jobs:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Install Conda environment using mamba
uses: mamba-org/provision-with-micromamba@v16
uses: mamba-org/setup-micromamba@v1
with:
environment-file: test/test-environment.yml
cache-env: true
channels: conda-forge,defaults
channel-priority: strict
cache-environment: true
condarc: |
channels:
- conda-forge
- defaults
channel_priority: strict
- name: Log environment details
run: |
Expand Down Expand Up @@ -118,17 +124,20 @@ jobs:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Install Conda environment using mamba
uses: mamba-org/provision-with-micromamba@v16
uses: mamba-org/setup-micromamba@v1
with:
environment-file: test/test-environment.yml
cache-env: true
channels: conda-forge,defaults
channel-priority: strict
cache-environment: true
condarc: |
channels:
- conda-forge
- defaults
channel_priority: strict
- name: Log environment details
run: |
Expand Down Expand Up @@ -189,7 +198,7 @@ jobs:
- ci-integration
- ci-static
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download coverage
id: download-unit
uses: actions/download-artifact@v3
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/zenodo-cache-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ jobs:
ref: ${{ env.GITHUB_REF }}

- name: Install Conda environment using mamba
uses: mamba-org/provision-with-micromamba@v16
uses: mamba-org/setup-micromamba@v1
with:
environment-file: test/test-environment.yml
cache-env: true
channels: conda-forge,defaults
channel-priority: strict
cache-environment: true
condarc: |
channels:
- conda-forge
- defaults
channel_priority: strict
- name: Log environment details
run: |
Expand Down
8 changes: 4 additions & 4 deletions src/pudl/convert/censusdp1tract_to_sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def censusdp1tract_to_sqlite(context):
# program happens to be in the user's path and named ogr2ogr. This is a
# fragile solution that will not work on all platforms, but should cover
# conda environments, Docker, and continuous integration on GitHub.
ogr2ogr = os.environ.get("CONDA_PREFIX", "/usr") + "/bin/ogr2ogr"
ogr2ogr = Path(os.environ.get("CONDA_PREFIX", "/usr")) / "bin/ogr2ogr"
# Extract the sippzed GeoDB archive from the Datastore into a temporary
# directory so that ogr2ogr can operate on it. Output the resulting SQLite
# database into the user's PUDL workspace. We do not need to keep the
Expand All @@ -86,10 +86,10 @@ def censusdp1tract_to_sqlite(context):
f"Move {out_path} aside or set clobber=True and try again."
)

logger.info("Extracting the Census DP1 GeoDB to %s", out_path)
logger.info(f"Extracting the Census DP1 GeoDB to {out_path}")
zip_ref.extractall(tmpdir_path)
logger.info("extract_root = %s", extract_root)
logger.info("out_path = %s", out_path)
logger.info(f"extract_root = {extract_root}")
logger.info(f"out_path = {out_path}")
subprocess.run(
[ogr2ogr, str(out_path), str(extract_root)], check=True # noqa: S603
)
Expand Down
Loading

0 comments on commit 4cab17f

Please sign in to comment.