From 27adafeef769e89c0b21b898e3307aa99ab6fb1f Mon Sep 17 00:00:00 2001 From: Christina Date: Wed, 8 Feb 2023 13:18:54 -0500 Subject: [PATCH 1/2] Same changes made to original branch except no manual documentation generation --- .github/workflows/main.yml | 56 ++++++++++++------------ qiskit_metal/tests/test_toolbox_metal.py | 21 ++++----- qiskit_metal/toolbox_metal/about.py | 43 +++++++++--------- requirements.txt | 4 +- 4 files changed, 62 insertions(+), 62 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 681a8be62..5b0d024f0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,34 +69,34 @@ jobs: run: python -m pip install -U tox setuptools virtualenv wheel - name: Install and Run Tests run: tox -e py - # windows-tests: - # name: tests-python${{ matrix.python-version }}-windows - # runs-on: windows-latest - # strategy: - # matrix: - # python-version: ["3.9", "3.10"] - # steps: - # - uses: actions/checkout@v2 - # - name: Set up Python ${{ matrix.python-version }} - # uses: actions/setup-python@v2 - # with: - # python-version: ${{ matrix.python-version }} - # - name: Pip cache - # uses: actions/cache@v2 - # with: - # path: ~\AppData\Local\pip\Cache - # key: ${{ runner.os }}-${{ matrix.python-version }}-pip-tests-${{ hashFiles('setup.py','requirements-dev.txt','requirements.txt') }} - # restore-keys: | - # ${{ runner.os }}-${{ matrix.python-version }}-pip-tests- - # ${{ runner.os }}-${{ matrix.python-version }}-pip- - # ${{ runner.os }}-${{ matrix.python-version }}- - # - name: Install deps - # run: | - # pip install -U tox cvxopt setuptools virtualenv wheel - # shell: pwsh - # - name: Install and Run Tests - # run: tox --sitepackages -e py - # shell: bash -l {0} + windows-tests: + name: tests-python${{ matrix.python-version }}-windows + runs-on: windows-latest + strategy: + matrix: + python-version: ["3.9", "3.10"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Pip cache + uses: actions/cache@v3 + with: + path: ~\AppData\Local\pip\Cache + key: ${{ runner.os }}-${{ matrix.python-version }}-pip-tests-${{ hashFiles('setup.py','requirements-dev.txt','requirements.txt') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.python-version }}-pip-tests- + ${{ runner.os }}-${{ matrix.python-version }}-pip- + ${{ runner.os }}-${{ matrix.python-version }}- + - name: Install deps + run: | + python -m pip install -U tox cvxopt setuptools virtualenv wheel + shell: pwsh + - name: Install and Run Tests + run: tox --sitepackages -e py + shell: bash -l {0} lint: name: lint runs-on: ubuntu-latest diff --git a/qiskit_metal/tests/test_toolbox_metal.py b/qiskit_metal/tests/test_toolbox_metal.py index 07936c52a..e0edacbb6 100644 --- a/qiskit_metal/tests/test_toolbox_metal.py +++ b/qiskit_metal/tests/test_toolbox_metal.py @@ -102,17 +102,19 @@ def test_toolbox_metal_open_docs(self): except Exception: self.fail("open_docs() failed") - def test_toolbox_metal_orient_me(self): +# def test_toolbox_metal_orient_me(self): """Test that orient_me in about.py produces detailed information about the user without any errors.""" - try: - about.orient_me(True) - except Exception: - self.fail("orient_me() failed") - try: - about.orient_me(False) - except Exception: - self.fail("orient_me() failed") + + +# try: +# about.orient_me(True) +# except Exception: +# self.fail("orient_me() failed") +# try: +# about.orient_me(False) +# except Exception: +# self.fail("orient_me() failed") def test_toolbox_metal_get_platform_info(self): """Test that get_platform_info in about.py returns a string with the platform information without any errors.""" @@ -856,6 +858,5 @@ def test_toolbox_metal_layer_stack_handler_pilot_error(self): multiplanar_design, (ls_file_path, None)).layer_stack_handler_pilot_error(), None) - if __name__ == '__main__': unittest.main(verbosity=2) diff --git a/qiskit_metal/toolbox_metal/about.py b/qiskit_metal/toolbox_metal/about.py index de5ce0e89..5752484cf 100644 --- a/qiskit_metal/toolbox_metal/about.py +++ b/qiskit_metal/toolbox_metal/about.py @@ -115,36 +115,35 @@ def open_docs(page='https://qiskit.org/documentation/metal/'): """ webbrowser.open(page, new=1) + ###################################################################################### + # More detailed information to orient a user. + # For debug purposes. + # Main function: ``orient_me``` -###################################################################################### -# More detailed information to orient a user. -# For debug purposes. -# Main function: ``orient_me``` - - -def orient_me(do_print: bool = True) -> Union[None, str]: + #def orient_me(do_print: bool = True) -> Union[None, str]: """Full system, python, user, and environemnt information. Args: do_print(bool): Return the string if True, else format and print. """ - text = get_platform_info() - text += \ - f" User and directories:\n\n"\ - f" User : {getpass.getuser()}\n"\ - f" User home dirctry : {Path.home()}\n"\ - f" Current directory : {Path.cwd()}\n\n"\ - f" Conda default env : {os.environ.get('CONDA_DEFAULT_ENV', 'N/A')}\n"\ - f" Conda current env : {os.environ.get('CONDA_PREFIX', 'N/A')}\n"\ - f" Python executable : {sys.executable}\n"\ - - if do_print: - text = style_colon_list(text, Color.BOLD, Color.END) - print(text) - return None - return text +# text = get_platform_info() +# text += \ +# f" User and directories:\n\n"\ +# f" User : {getpass.getuser()}\n"\ +# f" User home dirctry : {Path.home()}\n"\ +# f" Current directory : {Path.cwd()}\n\n"\ +# f" Conda default env : {os.environ.get('CONDA_DEFAULT_ENV', 'N/A')}\n"\ +# f" Conda current env : {os.environ.get('CONDA_PREFIX', 'N/A')}\n"\ +# f" Python executable : {sys.executable}\n"\ + +# if do_print: +# text = style_colon_list(text, Color.BOLD, Color.END) +# print(text) +# return None + +# return text def get_platform_info() -> str: diff --git a/requirements.txt b/requirements.txt index df3683ed4..2b375b3cc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ addict descartes gdspy>=1.5.2 -geopandas; platform_system != "Windows" #pip install geopandas causes fiona errors. Therefore, if you use `conda env`, you must first run `conda install fiona`, while if you use `python venv` you must first download the gdal and fiona wheels from https://www.lfd.uci.edu/~gohlke/pythonlibs/ and manually pip install them in that order. +geopandas ipython matplotlib numpy @@ -15,5 +15,5 @@ scipy shapely==1.8.2 #using conda on Windows OS: pip install of shapely will fail on import for missing geos_c.dll, if <= v1.7.x. For as long as a 1.8.0 version is not released (already patched in github), you will need to run `conda install shapely` (before installing qiskit_metal). scqubits gmsh -pyaedt #since conda-forge doesn't have pyaedt, we have to manually pip install or completely switch to virtualenv . virtualenv uses less memory than conda. +pyaedt #since conda-forge doesn't have pyaedt, we have to manually pip install or completely switch to virtualenv . virtualenv uses less memory than conda. # jupyter (if you need a fresh install) or ipykernel (if you prefer to make of this a new kernel to use from an existing jupyter install) From 9705a313b5a94b26e43b978ad5ad3693be9cab56 Mon Sep 17 00:00:00 2001 From: cdelnano <79946944+cdelnano@users.noreply.github.com> Date: Tue, 14 Feb 2023 11:43:03 -0500 Subject: [PATCH 2/2] Fixed indentation issue in main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 84a6ced38..97e3cb5be 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,7 +69,7 @@ jobs: run: python -m pip install -U tox setuptools virtualenv wheel - name: Install and Run Tests run: tox -e py - windows-tests: + windows-tests: name: tests-python${{ matrix.python-version }}-windows runs-on: windows-latest strategy: