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

Errors and warnings #9

Open
microprediction opened this issue May 26, 2022 · 3 comments
Open

Errors and warnings #9

microprediction opened this issue May 26, 2022 · 3 comments

Comments

@microprediction
Copy link

Just wondering aloud if these errors, which I believe ultimately come from seriate, could be obviated. I'll try to put together reproducible example but perhaps this is already known to you?

    E   TypeError: Descriptors cannot not be created directly.
    E   If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
    E   If you cannot immediately regenerate your protos, some other possible workarounds are:
    E    1. Downgrade the protobuf package to 3.20.x or lower.
    E    2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
    E   
    E   More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
@vmarkovtsev
Copy link
Collaborator

Hey, thanks for testing the library. No, I haven't seen this yet. Can you reproduce it in a Dockerfile?

@microprediction
Copy link
Author

microprediction commented Jun 1, 2022

Will do. In the meantime here's a longer trace below from my
github action tests.

This certainly isn't a minimalist example I apologize (it is this test) that eventually calls

   from seriate import seriate



    ============================= test session starts ==============================
    platform linux -- Python 3.7.13, pytest-7.1.2, pluggy-1.0.0
    rootdir: /home/runner/work/precise/precise
    collected 27 items / 20 errors
    
    ==================================== ERRORS ====================================
    _____________ ERROR collecting tests/test_examples_basic_usage.py ______________
    tests/test_examples_basic_usage.py:1: in <module>
        from precise.skaters.covarianceutil.covfunctions import cov_to_corrcoef
    precise/__init__.py:1: in <module>
        from precise.skatertools.m6.competition import m6_competition_entry
    precise/skatertools/m6/competition.py:3: in <module>
        from precise.skaters.portfoliostatic.allstaticport import random_port, PORT
    precise/skaters/portfoliostatic/allstaticport.py:4: in <module>
        from precise.skaters.portfoliostatic.hrpport import HRP_LONG_PORT, HRP_LS_PORT
    precise/skaters/portfoliostatic/hrpport.py:4: in <module>
        from precise.skaters.portfoliostatic.hrpportfactory import hierarchical_risk_parity_portfolio_factory
    precise/skaters/portfoliostatic/hrpportfactory.py:1: in <module>
        from precise.skaters.portfoliostatic.schurportfactory import hierarchical_seriation_portfolio_factory
    precise/skaters/portfoliostatic/schurportfactory.py:10: in <module>
        from seriate import seriate
    /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/seriate.py:6: in <module>
        from ortools.constraint_solver import pywrapcp, routing_enums_pb2
    /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/ortools/constraint_solver/routing_enums_pb2.py:3[8](https://github.com/microprediction/precise/runs/6699435043?check_suite_focus=true#step:7:9): in <module>
        create_key=_descriptor._internal_create_key),
    /opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/google/protobuf/descriptor.py:755: in __new__
        _message.Message._CheckCalledFromGeneratedFile()
    E   TypeError: Descriptors cannot not be created directly.
    E   If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.1[9](https://github.com/microprediction/precise/runs/6699435043?check_suite_focus=true#step:7:10).0.
    E   If you cannot immediately regenerate your protos, some other possible workarounds are:
    E    1. Downgrade the protobuf package to 3.[20](https://github.com/microprediction/precise/runs/6699435043?check_suite_focus=true#step:7:21).x or lower.
    E    2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
    E   
    E   More information: https://developers.google.com/protocol-buffers/docs/news/20[22](https://github.com/microprediction/precise/runs/6699435043?check_suite_focus=true#step:7:23)-05-06#python-updates

@microprediction
Copy link
Author

Ah okay getting to the bottom of this.

   ortools 7.8.7959 requires protobuf>=3.12.2

But the current version of protobuf (we're into the 4.x as I write) won't work. I tested a few and seriate seems to work fine up to about 3.20.1

I would suggest that

    3.12.2<=protobuf<=3.20.1

is a requirement for seriate at the moment. Of course, I'd love it if you supported ortools 8 and then this could be relaxed.

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

2 participants