Skip to content

Commit

Permalink
closes #82
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesWiesner committed Feb 23, 2024
1 parent 3d0b12a commit db1823b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ __pycache__/
*.yml

# ignore lock files created by spreadsheet programs
.~lock*.tsv
*.~lock*.tsv
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,9 @@ The following **optional arguments** can be set for further customization:
The input spreadsheet file needs to have the following columns:
- `package_name` (the offical name of the package)
- `version` (specify the version of the package you need by following the [package match specification syntax](https://docs.conda.io/projects/conda-build/en/latest/resources/package-spec.html#package-match-specifications))
- `installation_command` (the full installation command)
- `package_manager` (pip, conda, cran)
- `package_manager` (can be 'pip', 'conda', or 'cran')
- `conda_channel` (which conda channel to install from)
- `area` (e.g. "data wrangling", "plotting", etc.)
- `link` (the link to the package itself)
- `necessity` ("required": you find that this package should be available for all lab members, "optional": only you need it for your current project but maybe any future lab member might find it also useful in the future)
- `description` (a short description of what this package does)
- `comment` (optional comments if something is buggy or if you want to tell other users some useful information)
- `necessity` (can be 'required', 'optional')
- `language` (python, r, julia)
- `bug_flag` (can be 'linux','windows' or 'cross_platform')

Expand Down
8 changes: 4 additions & 4 deletions environments/packages.tsv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package_name version installation_command package_manager conda_channel area link necessity description comment language bug_flag
python conda install -c conda-forge python conda conda-forge language https://anaconda.org/conda-forge/python required the python programming language itself python
r-essentials conda install -c conda-forge r-essentials conda conda-forge data wrangling https://tinyurl.com/54j96j5x required The R Essentials bundle contains approximately 200 of the most popular R packages for data science, including the IRKernel, dplyr, shiny, ggplot2, tidyr, caret, and nnet. It is used as an example in the following guides. r
r-base conda install -c conda-forge r-base conda conda-forge language https://anaconda.org/conda-forge/r-base required the R programming language itself r
package_name version package_manager conda_channel necessity language bug_flag
python conda conda-forge required python
r-essentials conda conda-forge required r
r-base conda conda-forge required r
2 changes: 1 addition & 1 deletion tcy.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def run(operating_system,yml_name=None,yml_file_name='environment.yml',pip_requi
if not languages == 'all':
df = df.loc[df['language'].isin(languages),:]

# filter for necessitiy if specified by user
# filter for necessity if specified by user
if not necessity == 'all':
df = df.loc[df['necessity'].isin(necessity),:]

Expand Down
5 changes: 1 addition & 4 deletions test_configs.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"valid_columns": ["package_name", "version", "installation_command", "package_manager", "conda_channel", "area","link", "necessity", "description", "comment", "language", "bug_flag"],
"valid_columns": ["package_name", "version","package_manager","conda_channel","necessity","language","bug_flag"],
"filled_out_columns": ["package_name","language"],
"valid_options": {"package_manager":["conda","pip","cran"],"language":["python","r","julia"],"bug_flag":["linux","windows","cross-platform"]},
"column_dependencies": null,
"multi_option_columns": null
}



9 changes: 4 additions & 5 deletions test_tsv_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,14 @@ def create_mask(cell):
message = f"These cells have either leading or trailing whitespaces: {', '.join(cells)}"
pytest.fail(message)

# FIXME: Should test for equality not for subset!
def test_valid_columns(self):
'''Test that dataframe has all necessary columns'''

if self.valid_columns:
if list(self.df.columns) != self.valid_columns:
pytest.fail(f"datasets.tsv must have only these columns in that exact order: {', '.join(self.valid_columns)}")

if not set(self.df.columns).issubset(self.valid_columns):
pytest.fail(f"The .tsv file must have at least these columns: {', '.join(self.valid_columns)}")

def test_filled_out_columns(self):
'''Check that certain columns are completely filled out'''

Expand Down

0 comments on commit db1823b

Please sign in to comment.