-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from USEPA/release_v1.0.3
Release v1.0.3
- Loading branch information
Showing
19 changed files
with
1,855 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# This workflow tests the generation of impact methods | ||
|
||
name: Generate and store impact methods | ||
|
||
on: | ||
pull_request: | ||
branches: [master, develop] | ||
types: [opened, reopened, ready_for_review] # excludes syncronize to avoid redundant trigger from commits on PRs | ||
workflow_dispatch: # also allow manual trigger, for testing purposes | ||
|
||
jobs: | ||
generate_methods: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Update pip & install testing pkgs | ||
run: | | ||
python -VV | ||
python -m pip install --upgrade pip setuptools wheel | ||
pip install pytest pytest-cov flake8 | ||
# install package & dependencies | ||
- name: Install package and dependencies | ||
run: | | ||
pip install . | ||
- name: Generate and store methods | ||
run: | | ||
pytest -m generate_methods | ||
- name: Upload files | ||
if: always() | ||
uses: actions/upload-artifact@v3.1.1 | ||
with: | ||
# Artifact name | ||
name: lciafmt_methods | ||
# A file, directory or wildcard patter that describes what to upload | ||
path: | | ||
# ~/Library/Application Support/lciafmt/* | ||
~/Library/Application Support/lciafmt/diff/* | ||
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn` | ||
# retention-days: 5 # cannot exceed the retention limit set by the repository, organization, or enterprise. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# custom.py (lciafmt) | ||
# !/usr/bin/env python3 | ||
# coding=utf-8 | ||
""" | ||
Functions to create custom manual methods | ||
""" | ||
|
||
import pandas as pd | ||
|
||
from lciafmt.df import lciafmt_cols | ||
|
||
def get_custom_method(file: str=None, input_df=None): | ||
"""Converts a dataframe or a csv filepath to a dataframe suitable for | ||
lciafmt. If `file` is passed, input_df is ignored. | ||
""" | ||
if file: | ||
input_df = pd.read_csv(file) | ||
if (pd.Series(['Characterization Factor', 'Flowable', 'Context']) | ||
.isin(input_df.columns).all()): | ||
df = input_df.reindex(columns=lciafmt_cols) | ||
df = df.fillna('') | ||
return df | ||
else: | ||
raise Exception | ||
|
Oops, something went wrong.