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

Issues after installation of new GNPy SW on VM during the pytest of gnpy: Wrong release for xlrd and issue with import of Element Tree #505

Open
filip-nikolic opened this issue Apr 22, 2024 · 0 comments
Assignees

Comments

@filip-nikolic
Copy link

filip-nikolic commented Apr 22, 2024

I performed installation of new GNPy on VM and I want to share my findings with you. I hope that it will be useful :)

Installation of GNPy was done on new Linux VM. OS is ubuntu 22.04.

As a precondition I did installation of anaconda3 python distribution.
After installation this is the status:

(base) user@GNPy:~$ pip show xlrd
Name: xlrd
Version: 1.2.0
Summary: Library for developers to extract data from Microsoft Excel (tm) spreadsheet files
Home-page: http://www.python-excel.org/
Author: John Machin
Author-email: sjmachin@lexicon.net
License: BSD
Location: /home/infinera/anaconda3/lib/python3.11/site-packages
Requires:
Required-by: gnpy

user@GNPy:~$ pip show pandas
Name: pandas
Version: 2.1.4
Summary: Powerful data structures for data analysis, time series, and statistics
Home-page: https://pandas.pydata.org
Author:
Author-email: The Pandas Development Team pandas-dev@python.org
License: BSD 3-Clause License

user@GNPy:~$ python -V
Python 3.11.7

And installation of anaconda3 distribution.
image

Installation of GNPy is run according to:
pip install --editable .

After installation I run test of gnpy.

(base) user@GNPy:$ python -c 'import gnpy'
(base) user@GNPy:
$ pytest

The result of test was:

oopt-gnpy/tests/test_amplifier.py ................................................................................................................. [ 21%]
oopt-gnpy/tests/test_automaticmodefeature.py . [ 22%]
oopt-gnpy/tests/test_disjunction.py ............................ [ 27%]
oopt-gnpy/tests/test_equalization.py ................................................................................................................................ [ 52%]
oopt-gnpy/tests/test_gain_mode.py ......... [ 54%]
oopt-gnpy/tests/test_info.py . [ 54%]
oopt-gnpy/tests/test_invocation.py ................. [ 57%]
oopt-gnpy/tests/test_logger.py ...FF...........FFFFFFFFFF [ 62%]
oopt-gnpy/tests/test_network_functions.py .............................. [ 68%]
oopt-gnpy/tests/test_parameters.py .. [ 69%]
oopt-gnpy/tests/test_parser.py F..F.................................. [ 76%]
oopt-gnpy/tests/test_propagation.py ......................... [ 81%]
oopt-gnpy/tests/test_roadm_restrictions.py .............................. [ 87%]
oopt-gnpy/tests/test_science_utils.py ..... [ 88%]
oopt-gnpy/tests/test_spectrum_assignment.py ............................................................. [100%]

====================================================================================== FAILURES =======================================================================================

_ test_wrong_xls_service[wrong_service.xlsx-testTopology.xls-Service error: Request Id: 0 - could not find tsp : 'Voyager' with mode: 'Mode 10' in eqpt library \nComputation stopped.]

Please check the logs for complete output of errors in attachment.

Logs_after_installation.txt

By help of Esther Lerouzic we successfully manage to fix the issues in two steps.

  1. Wrong release for xlrd, we coudn't use excel input.

This issue was fixed by adding of lines in convert.py and service_sheet.py (just before "from xlrd import open_workbook.......")

Lines are:

image

  1. After this only issue was warning:

======================================================================================= warnings summary ========================================================================================
anaconda3/lib/python3.11/site-packages/xlrd/xlsx.py:39
/home/user/anaconda3/lib/python3.11/site-packages/xlrd/xlsx.py:39: DeprecationWarning: defusedxml.cElementTree is deprecated, import from defusedxml.ElementTree instead.
try: import defusedxml.cElementTree as ET

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================================ 514 passed, 1 warning in 50.92s ================================================================================

We solved this by editing of xlsx.py file in folder /home/user/anaconda3/lib/python3.11/site-packages/xlrd/

In file xlsx.py we replaced cElementTree with ElementTree

Before change:
image

After change:

image

After this i run the pytest again and it was successful.

@EstherLerouzic EstherLerouzic self-assigned this Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@EstherLerouzic @filip-nikolic and others