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

New util funcs v159 #169

Merged
merged 15 commits into from
Aug 16, 2024
Merged

Conversation

felicio93
Copy link
Collaborator

4 util functions added:

  • clip_elements_by_index #based on previous river-in-mesh code from Soorosh
  • cleanup_skewed_el #based on elements internal angles, removes both tria and quad
  • cleanup_concave_quads
  • quadrangulate_rivermapper_arcs #based on RiverMapper diagnostic arcs

Two test Classes were created:

  • QuadCleanup

    • Example mesh created during test setup:
      image
    • this mesh contains 4 quads (1 skewed, 1 concave) and 1 skewed triangle
    • the tests for cleanup_skewed_el, cleanup_concave_quads, and clip_elements_by_index check for the proper removal of elements
  • RiverMapper

    • RiverMapper arcs used:

image

  • Here it is tested if the correct number of quads were created
  • Future RiverMapper-based functions should be added under this class.

@felicio93
Copy link
Collaborator Author

felicio93 commented Aug 16, 2024

@SorooshMani-NOAA,

I followed your suggestions to fix the Functional (pip) 3.10 and 3.11.
I removed colored-traceback from the yaml and toml files, it then passed the tests. But it failed the pylint test because some code was calling this library. I then fixed colored-traceback<=0.3.0 in the yaml and toml files and now it is passing all tests.

  • For the Functional pip Python 3.9 test, as you know it fails to install scipy 1.14.0:

    Processing scipy-1.14.0.tar.gz
    error: Couldn't find a setup script in /tmp/easy_install-m5y_azqi/scipy-1.14.0.tar.gz

    That happens because scipy-1.14.0 requires Python 3.10+ here.
    and it ends up installing scipy-1.13.1

    Looking back at the dates of my previous PR. The first one successfully passed this test because it was before the release of scipy 1.14 (end of May)

I am still going to investigate this further because I don't think that this necessary breaks the code anywhere.

@SorooshMani-NOAA
Copy link
Collaborator

Thanks for looking into this @felicio93. I we can either pin the scipy version, or increase the min python version to be 3.10 and above. For now I'd go with scipy, if it resolves the issue.

In general we have to quickly find a fix for any pinned version. I think the colored traceback usage is not that important, so we can slowly start removing parts of the code that reference it.

@felicio93
Copy link
Collaborator Author

felicio93 commented Aug 16, 2024

@SorooshMani-NOAA, pinning scipy on our end won't help. The issue seems to be coming from the jigsawpy setup. It uses the latest scipy (1.41, which in turn does not support python 3.9).

So test fails to install jigsawpy, because it tries to do that from python 3.9, and jigsawpy will fail to install scipy 1.14 .

I tested creating a python env with python 3.9 on my local and then pip installing ocsmesh.
It seems to work just fine, nothing is broken.

I guess, because jigsawpy is installed using conda install -y -c conda-forge jigsawpy before we pip install ocsmesh, that problem does not happen?

I can reproduce the test fail if I try to install OCSMesh from the Repo from a python 3.9 environment using:
python ./setup.py install_jigsaw

I suggest we ignore this Functional (pip) / Python 3.9 fail for now, and submit a ticket to the jigsawpy repo. what do you think? Maybe we can update the readme file with Python>=3.10 in the meantime?

@SorooshMani-NOAA
Copy link
Collaborator

There's a quickfix for this ... In the test script:

run: |
pip install packaging # jigsaw dependency in its setup.py
python ./setup.py install_jigsaw
pip install .

we can first install scipy < 1.14 after packaging, then install jigsaw (python setup.py install_jigsaw) and after that install ocsmesh (pip install .). Jigsaw doesn't seem to have a version dependency for scipy; it just picks up latest available (if scipy is not installed) since nothing tells it not to. See if my suggestion works or not, if it doesn't, then we can drop Python 3.9.

There's one thing that's still strange for me ... if jigsaw doesn't have an explicit version dependency, why does it still try to get latest scipy if it's not supported for python 3.9?!!

@felicio93
Copy link
Collaborator Author

added pip install scipy=<1.13 to the test.yml:

We still get the same result from pip install packaging # jigsaw dependency in its setup.py
jigsaw tries to install the latest scipy and that fails for python 3.9. That is why I mentioned we might want to submit an issue to them? it seems like if they fix that, we could still support python 3.9, right?

@felicio93
Copy link
Collaborator Author

After discussion with Soroosh, it is probable that the Functional (pip) / Python 3.9 is coming from the jigsawpy side. Investigation would require isolate and reproduce the problem.

The short term solution will be to drop OCSMesh Python 3.9 support.

I removed the Functional (pip) / Python 3.9 test. and updated the readme file. All other testes passed.

I am proceeding with the PR

@felicio93 felicio93 marked this pull request as ready for review August 16, 2024 19:17
@felicio93 felicio93 merged commit aec574f into noaa-ocs-modeling:main Aug 16, 2024
9 checks passed
@felicio93 felicio93 deleted the new_util_funcs_v159 branch August 16, 2024 19:19
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

Successfully merging this pull request may close these issues.

2 participants