Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pandas 2 Compatibility #193

Merged
merged 3 commits into from
Aug 15, 2023
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
6 changes: 3 additions & 3 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
fail-fast: False
matrix:
include:
- python-version: "3.7"
other-packages: "mlst 'numpy <1.23.5' 'pandas <2'"
- python-version: "3.9"
other-packages: "mlst numpy pandas"

steps:
- uses: actions/checkout@v2
Expand All @@ -47,7 +47,7 @@ jobs:
conda config --add channels bioconda
conda install -n base conda-libmamba-solver
conda config --set solver libmamba
conda install Cython blast git ${{ matrix.other-packages }} -y
conda install Cython blast git perl-list-moreutils ${{ matrix.other-packages }} -y

- name: Setup python packages
shell: bash -l {0}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Unreleased

* Upgraded to pandas version 2.
* Added CGE-predicted phenotypes to Pointfinder output.
* The resfinder.tsv and pointfinder.tsv outputs now contain a Notes column.
* Updated the help description of the --mlst-scheme parameter to include a more useful link for available schemas.
Expand Down
4 changes: 2 additions & 2 deletions staramr/subcommand/Search.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def _print_dataframes_to_excel(self, outfile_path, summary_dataframe, resfinder_
settings_dataframe.to_excel(writer, 'Settings')
self._resize_columns({'Settings': settings_dataframe}, writer, max_width=75, text_wrap=False)

writer.save()
writer.close()

def _resize_columns(self, sheetname_dataframe, writer, max_width, text_wrap=True):
"""
Expand Down Expand Up @@ -555,7 +555,7 @@ def run(self, args):
logger.info("Writing Excel to [%s]", output_excel)
settings_dataframe = pd.DataFrame.from_dict(settings, orient='index')
settings_dataframe.index.name = 'Key'
settings_dataframe.set_axis(['Value'], axis='columns', inplace=True)
settings_dataframe = settings_dataframe.set_axis(['Value'], axis='columns', copy=False)

self._print_dataframes_to_excel(output_excel,
amr_detection.get_summary_results(),
Expand Down
Loading