Skip to content

Commit

Permalink
Merge pull request #441 from pepkit/dev
Browse files Browse the repository at this point in the history
Release v0.35.5
  • Loading branch information
nsheff authored Mar 27, 2023
2 parents cac87fb + 25c6013 commit 8449635
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 19 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,9 @@ peppy.egg-info/
env/
.env
venv/
.venv/
.venv/

# swap files
.swp
.swo
.swn
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ Links to complete documentation:
* Complete documentation and API for the `peppy` python package is at [peppy.databio.org](https://peppy.databio.org).
* Reference documentation for standard **PEP** format is at [pep.databio.org](https://pep.databio.org/).
* Example PEPs for testing `peppy` are in the [example_peps repository](https://github.com/pepkit/example_peps).
* The package [on PyPI](https://pypi.org/project/peppy/).
5 changes: 5 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.

## [0.35.5] -- 2023-03-27
### Fixed
- A [bug](https://github.com/pepkit/peppy/issues/435) with custom sample ids
- Improved performance for large tables dramatically

## [0.35.4] -- 2023-01-17
### Fixed
- Fixed disabling rich progress on small datasets bug
Expand Down
2 changes: 1 addition & 1 deletion peppy/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.35.4"
__version__ = "0.35.5"
27 changes: 13 additions & 14 deletions peppy/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,26 +635,23 @@ def _all_values_in_the_list_are_the_same(list_of_values: List) -> bool:
return all(value == list_of_values[0] for value in list_of_values)

def _get_duplicated_sample_ids(self, sample_names_list: List) -> set:
return set(
[
sample_id
for sample_id in track(
sample_names_list,
description="Detecting duplicate sample names",
disable=not (self.is_sample_table_large and self.progressbar),
console=Console(file=sys.stderr),
)
if sample_names_list.count(sample_id) > 1
]
)
duplicated_ids = set()
seen = set()

for sample_id in sample_names_list:
if sample_id in seen:
duplicated_ids.add(sample_id)
else:
seen.add(sample_id)

return duplicated_ids

@staticmethod
def _get_merged_attributes(
sample_attributes: List[str], duplicated_samples: List[Sample]
) -> dict:
merged_attributes = {}
for attr in sample_attributes:

attribute_values = []
for sample in duplicated_samples:
attribute_value_for_sample = getattr(sample, attr, "")
Expand Down Expand Up @@ -836,7 +833,9 @@ def attr_derive(self, attrs=None):
_LOGGER.debug("'{}' has been derived".format(attr))
continue
_LOGGER.debug(
"Deriving '{}' attribute for '{}'".format(attr, sample.sample_name)
"Deriving '{}' attribute for '{}'".format(
attr, sample[self.st_index]
)
)

# Set {atr}_key, so the original source can also be retrieved
Expand Down
1 change: 0 additions & 1 deletion peppy/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class Sample(PathExAttMap):
"""

def __init__(self, series, prj=None):

super(Sample, self).__init__()

data = OrderedDict(series)
Expand Down
1 change: 0 additions & 1 deletion requirements/requirements-all.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
attmap>=0.13.2
logmuse>=0.2
pandas>=0.24.2
pyyaml
rich>=10.3.0
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# Additional keyword arguments for setup().
extra = {"install_requires": DEPENDENCIES}


# Additional files to include with package
def get_static(name, condition=None):
static = [
Expand Down
1 change: 0 additions & 1 deletion tests/test_Project.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ def test_get_sample_nonexistent(self, example_pep_cfg_path):
"""Verify that sample getting returns ValueError if not sample found"""
p = Project(cfg=example_pep_cfg_path)
with pytest.raises(ValueError):

p.get_sample(sample_name="kdkdkdk")


Expand Down

0 comments on commit 8449635

Please sign in to comment.