• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PrincetonUniversity / cutqc2 / 17590996728

09 Sep 2025 05:42PM UTC coverage: 74.955% (-0.1%) from 75.079%
17590996728

Pull #9

github

web-flow
Merge 0dcfb529e into b413458cf
Pull Request #9: wrapper over cupy/numpy; config class

75 of 99 new or added lines in 9 files covered. (75.76%)

1251 of 1669 relevant lines covered (74.96%)

0.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/cutqc2/numeric/numpy.py
NEW
1
import contextlib
×
2

NEW
3
import numpy as np
×
4

NEW
5
cp = None
×
NEW
6
with contextlib.suppress(ModuleNotFoundError):
×
NEW
7
    import cupy as cp
×
8

9

NEW
10
class Numpy:
×
NEW
11
    name: str = "numpy"
×
12

NEW
13
    @staticmethod
×
NEW
14
    def asnumpy(x):
×
15
        """
16
        Ensure `asnumpy` is always available and returns a numpy array.
17
        """
NEW
18
        if cp and isinstance(x, cp.ndarray):
×
NEW
19
            x = x.get()
×
NEW
20
        return x
×
21

NEW
22
    def __getattr__(self, item):
×
23
        """
24
        Catch-all method to to allow a straight pass-through \
25
        of any attribute that is not supported above.
26
        """
NEW
27
        return getattr(np, item)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc