Skip to content

Resolve 30 skipped tests after all dependencies are installed and released correctly #90

Closed

Description

@bobleesj

30 tests are skipped when pyobjcryst, diffpy.structure, diffpy.srreal, sas are not installed.

Current result without installing the dependencies mentioned above:

conda create -n diffpy.srfit_312 python=3.12
conda activate diffpy.srfit_312
pip install -r requirement/run.txt  # scipy, numpy, matplotlib (at the moment)
pip install . --no-deps
pytest

====== 80 passed, 30 skipped, 1 warning in 0.43s =====

Activity

  1. sbillinge commented on Sep 26, 2024

    @sbillinge
    Contributor

    I think we don't want to skip these, so we just have CI install these things?

  2. bobleesj commented on Sep 26, 2024

    @bobleesj
    Author

    yes we don't want to, while we re-cookiecut, i will add these dependencies under run.txt and see what happens.

  3. bobleesj commented on Sep 29, 2024

    @bobleesj
    Author

    Discussed with @sbillinge in #89

    • include optional dependencies such as diffpy.structure under run-ext.txt
  4. sbillinge commented on Sep 30, 2024

    @sbillinge
    Contributor

    reopening. Let's close when it is merged into main and fully resolved.

  5. zmx27 commented on Aug 3, 2025

    @zmx27
    Contributor

    I suggest that we move this issue to a later release because this can only be done when all of our other packages are released. Additionally, we are facing problems with sasmodels right now as discussed in #126

  6. sbillinge commented on Aug 3, 2025

    @sbillinge
    Contributor

    Please can you review how many skips we have left now, and how many are related to the sas issue, just for review.

  7. zmx27 commented on Aug 4, 2025

    @zmx27
    Contributor

    Here is the result of running pytest after the changes in #126:

    ========================================== warnings summary ==========================================
    tests/test_sas.py::test_generator
    tests/test_sas.py::testGenerator2
      /Users/zhimingxu/miniconda3/envs/srfit-env/lib/python3.13/site-packages/pyopencl/cache.py:496: CompilerWarning: Non-empty compiler output encountered. Set the environment variable PYOPENCL_COMPILER_OUTPUT=1 to see more.
        _create_built_program_from_source_cached(
    
    tests/test_sas.py::test_generator
    tests/test_sas.py::testGenerator2
      /Users/zhimingxu/miniconda3/envs/srfit-env/lib/python3.13/site-packages/pyopencl/cache.py:500: CompilerWarning: Non-empty compiler output encountered. Set the environment variable PYOPENCL_COMPILER_OUTPUT=1 to see more.
        prg.build(options_bytes, devices)
    
    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
    ============================= 84 passed, 27 skipped, 4 warnings in 5.24s =============================
    

    Although I'm still in progress with refactoring the code to use the updated sasview api, I dealt with the three tests in test_sas.py that were initially skipped. Next, there are four more tests in test_characteristicfunctions.py that has to be skipped because the calculate_ER function raises a NotImplementedError. This makes for a total of 7 tests total out of the original 30 skipped tests that are related to the sas issue.

  8. ycexiao commented on Aug 4, 2025

    @ycexiao
    Contributor

    I have successfully run other tests. There are two similar errors

            stru = PDFFitStructure()
            ciffile = datafile("ni.cif")
    >       stru.read(ciffile)
    
    tests/test_pdf.py:163: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    ../diffpy.structure/src/diffpy/structure/pdffitstructure.py:75: in read
        p = Structure.read(self, filename, format)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../diffpy.structure/src/diffpy/structure/structure.py:285: in read
        new_structure = p.parseFile(filename)
                        ^^^^^^^^^^^^^^^^^^^^^
    ../diffpy.structure/src/diffpy/structure/parsers/p_auto.py:146: in parseFile
        return self._wrapParseMethod("parseFile", filename)
    
    

    The reason is that the current version of diffpy.structure accepts a filename string, not a filename pathlib.Path. It is also mentioned in diffpy/diffpy.structure#124

  9. sbillinge commented on Aug 4, 2025

    @sbillinge
    Contributor

    Great, thanks. Let's make sure that any unmerged issues from this list have their own issue on diffpy.structure or diffpy.srfit for us to fix later (for example, but not limited to, the sas issues). Then we can close this.

  10. sbillinge commented on Aug 6, 2025

    @sbillinge
    Contributor

    closing as addressed by fixing or creating issues.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions