Skip to content

make sure CI errors go away when tskit removes parent ordering #232

Closed

Description

@petrelharp

See https://github.com/MesserLab/SLiM/runs/3946440358?check_suite_focus=true - currently the pyslim tests fail with

E           _tskit.LibraryError: Individuals must be provided in an order where children are after their parent individuals

... as expected. But this is a reminder to us to make sure that it works again.

Activity

  1. added
    trees
    on Oct 24, 2021
  2. bhaller commented on Nov 11, 2021

    @bhaller
    Contributor

    @rdinnager will want to enable the tskit tests for the Windows build once this is resolved; they are disabled for now, that that the Windows tests are green for him. So, tagging him here so he's in the loop.

  3. bhaller commented on Dec 8, 2021

    @bhaller
    Contributor

    OK, so. I have merged tskit C_0.99.15 into SLiM, resolved all the issues with it that I can see, run all my local tests on it including crosscheck (all tests are green except for three known cases where the test suite fails crosscheck for unrelated reasons), and merged that tskit_one_point_oh branch down into master. However, the CI tests are still failing with the same "Individuals must be provided in an order..." error. This is a bit surprising to me. The changes to tskit to remove the Individuals table ordering requirement are done, and are out in C_0.99.15, which is an official release. I thought that the CI tests automatically ran against the current release version of tskit, so I expected the tests to go green now that everything is in sync... but they didn't. @petrelharp, do you understand why?

  4. petrelharp commented on Dec 9, 2021

    @petrelharp
    CollaboratorAuthor

    Ok, this is expected, since the release version of tskit is still 0.3.7, and those tests are running using python (not the library internal to SLiM).

    HOWEVER, if I switch to (locally installed) tskit 0.4.0b1 to see if things will work when 0.4.0 is released, then I get the

    
        def __init__(self, ts, reference_sequence=None, legacy_metadata=False):
            self.legacy_metadata = legacy_metadata
            if not (isinstance(ts.metadata, dict) and 'SLiM' in ts.metadata
                    and ts.metadata['SLiM']['file_version'] in compatible_slim_file_versions):
                tables = ts.dump_tables()
                if not (isinstance(tables.metadata, dict) and 'SLiM' in tables.metadata):
                    _set_metadata_from_provenance(tables)
                if tables.metadata['SLiM']['file_version'] != slim_file_version:
                    _upgrade_old_tables(tables)
                    # cannot assign directly to keys of metadata
                    md = tables.metadata
                    md['SLiM']['file_version'] = slim_file_version
                    tables.metadata = md
                ts = tables.tree_sequence()
            super().__init__(ts._ll_tree_sequence)
    >       self.reference_sequence = reference_sequence
    E       AttributeError: can't set attribute
    
    /home/peter/.local/lib/python3.9/site-packages/pyslim/slim_tree_sequence.py:170: AttributeError
    

    error. So, I need to deal with that first.

  5. bhaller commented on Dec 9, 2021

    @bhaller
    Contributor

    Aha. I guess there's something I don't understand about tskit releases, then, because if I go to:

    https://github.com/tskit-dev/tskit/releases

    then "C API 0.99.15" is marked "latest"? That's why I was expecting that this problem would fix itself. Hmm. Is the official Python release not in sync with the official C API release?

  6. bhaller commented on Dec 12, 2021

    @bhaller
    Contributor
  7. bhaller commented on Dec 12, 2021

    @bhaller
    Contributor

    So, Ben Jeffery (deliberately not tagged) wrote:

    according to the log in the run you have linked above tskit 0.3.7 is being used. This is because you are using cached dependancies.

    So, the mystery now is how to force a recache of the cached tskit 0.3.7, to move up to 0.4.0. @grahamgower or @rdinnager or @petrelharp anybody know? I'll start googling now but I don't know anything about this GitHub Actions stuff...

  8. bhaller commented on Dec 12, 2021

    @bhaller
    Contributor

    @benjeffery (tagging in the hopes you can provide a bit more guidance :->) then wrote:

    The caching is based on a hash of treerec/tests/pip-requirements.txt so any change to that file will force the dependencies to be regenerated.

    So, I'm looking at that file. It has:

    setuptools
    filelock
    numpy
    pytest
    pytest-xdist
    

    It does not list tskit or msprime; they are instead listed in treerec/tests/conda-requirements.txt. I wonder whether changing that file also forces a recache? And I wonder what sort of change I ought to make, to safely trigger the recache; are comments allowed in these files? Extraneous spaces?

    A comment about all this ought to be added to treerec/tests/README.md once it is figured out.

  9. grahamgower commented on Dec 12, 2021

    @grahamgower
    Contributor

    The cache step (docs here) has a key field that defines when to invalidate the cache:

    key: ${{ runner.os }}-${{ matrix.python}}-conda-v10-${{ hashFiles('treerec/tests/conda-requirements.txt') }}-${{ hashFiles('treerec/tests/pip-requirements.txt') }}
    

    So any change to the conda-requirements.txt or pip-requirements.txt should invalidate the cache. You can also bump the v10 in that key field to invalidate the cache. Given you want to explicitly use the newer tskit, I recommend adding tskit >= 0.4.0b1 to the pip-requirements.txt.

  10. bhaller commented on Dec 12, 2021

    @bhaller
    Contributor

    Hi @grahamgower. I was just about try to bumping that v10 to v11 to see if it did anything; thanks for the reassurance on that point. :->

    Given you want to explicitly use the newer tskit, I recommend adding tskit >= 0.4.0b1 to the pip-requirements.txt.

    So, right now tskit is listed in conda-requirements.txt not pip-requirements.txt. Are you proposing that I should add tskit >= 0.4.0b1 to pip-requirements.txt, or did you mean that I should change the existing line in conda-requirements.txt? Also, the b1 should not be needed, right? AFAIK version 0.4.0 is released.

  11. grahamgower commented on Dec 12, 2021

    @grahamgower
    Contributor

    Hi @grahamgower. I was just about try to bumping that v10 to v11 to see if it did anything; thanks for the reassurance on that point. :->

    Given you want to explicitly use the newer tskit, I recommend adding tskit >= 0.4.0b1 to the pip-requirements.txt.

    So, right now tskit is listed in conda-requirements.txt not pip-requirements.txt. Are you proposing that I should add tskit >= 0.4.0b1 to pip-requirements.txt, or did you mean that I should change the existing line in conda-requirements.txt? Also, the b1 should not be needed, right? AFAIK version 0.4.0 is released.

    Oh, if its already in the conda-requirements, then yes, just whack in the version requirement there. And I didn't realise that tskit 0.4.0 had shipped --- not sure how I missed that .:0

  12. grahamgower commented on Dec 12, 2021

    @grahamgower
    Contributor

    are comments allowed in these files? Extraneous spaces?

    Yes, you can start a comment with a # in both pip requirements and conda requirements files.

  13. bhaller commented on Dec 12, 2021

    @bhaller
    Contributor

    OK, the tskit version issue appears to be fixed:

    https://github.com/MesserLab/SLiM/runs/4498983347?check_suite_focus=true

    Thanks for the help @grahamgower and @benjeffery.

    The tests are still red, but now for reasons having to do with pyslim I think. So, @petrelharp, you can mark this as fixed when you've got that sorted. :->

  14. benjeffery commented on Dec 13, 2021

    @benjeffery

    Sorry for leading you astray - I thought tskit would be in treerec/tests/pip-requirements.txt. We have wheels for Windows, OSX and linux for all of Python 3.7->3.10 so you don't have to use conda.

  15. bhaller commented on Dec 13, 2021

    @bhaller
    Contributor

    Sorry for leading you astray - I thought tskit would be in treerec/tests/pip-requirements.txt.

    No worries, got it sorted. Your help was extremely useful! :->

    We have wheels for Windows, OSX and linux for all of Python 3.7->3.10 so you don't have to use conda.

    Well, I guess the present CI design (now that I understand how to maintain it :->) works, so maybe if it ain't broke don't fix it, I don't know. Anyhow, none of this is in my wheelhouse at all (pun intended, I'm afraid :->), but if @grahamgower who designed the GitHub CI for SLiM wants to change it over to using wheels, I'd have no objection. I don't know what the pros/cons of that choice would be.

  16. grahamgower commented on Dec 13, 2021

    @grahamgower
    Contributor

    I don't recall precisely, but the conda bits were probably included to get msprime installed without gsl annoyances. Not sure if that's still needed (e.g. for windows).

  17. bhaller commented on Dec 13, 2021

    @bhaller
    Contributor

    I don't recall precisely, but the conda bits were probably included to get msprime installed without gsl annoyances. Not sure if that's still needed (e.g. for windows).

    I am fine with "if it ain't broke, don't fix it" here; I don't see that it ought to really make any difference, except that maybe (?) it would remove the need to bump GitHub Action's cache, but now that I know how to do that, it's fine. :->

  18. bhaller commented on Dec 13, 2021

    @bhaller
    Contributor

    @rdinnager all tests are now green, yay! IIRC you had disabled the tskit tests for Windows somehow, so that you could get your tests on Windows to go green. I believe it is now time for you to re-enable them. If you point me towards how/where you did it, I'm happy to make the change. Thanks!

  19. bhaller commented on Dec 14, 2021

    @bhaller
    Contributor

    All tests are green, so this is fixed. I will open a separate issue on adding the tskit tests to the CI on Windows, since it sounds like that may not happen until after the 3.7 release cycle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    prioritytrees

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions