Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gtfparse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .parsing_error import ParsingError
from .read_gtf import read_gtf_as_dataframe, read_gtf_as_dict

__version__ = "0.1.0"
__version__ = "0.2.0"

__all__ = [
"expand_attribute_strings",
Expand Down
10 changes: 9 additions & 1 deletion gtfparse/attribute_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,15 @@ def expand_attribute_strings(
value = intern(str(value))
value_interned_strings[value] = value

column[i] = value
# if an attribute is used repeatedly then
# keep track of all its values in a list
current_row = column[i]
if current_row == missing_value:
column[i] = value
elif type(current_row) is list:
current_row.append(value)
else:
column[i] = [value]

logging.debug(
"Memory usage after expanding GTF attributes: %0.4f MB" % (
Expand Down