PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes
python_coverage_gate.PathAwareIgnore Class Reference

Public Member Functions

 __init__ (self, list[str] ignoredirs)
 Store normalized ignored directory roots.
 
bool names (self, filename, str modulename)
 Decide by full path whether a module is ignored.
 

Protected Attributes

 _ignoredirs
 

Detailed Description

Avoid stdlib trace's basename-only ignore cache for same-named modules.

Definition at line 20 of file python_coverage_gate.py.

Constructor & Destructor Documentation

◆ __init__()

python_coverage_gate.PathAwareIgnore.__init__ (   self,
list[str]  ignoredirs 
)

Store normalized ignored directory roots.

Parameters
[in]ignoredirsDirectory roots to ignore.

Definition at line 23 of file python_coverage_gate.py.

23 def __init__(self, ignoredirs: list[str]):
24 """! @brief Store normalized ignored directory roots. @param[in] ignoredirs Directory roots to ignore. """
25 self._ignoredirs = [os.path.normpath(path) for path in ignoredirs]
26

Member Function Documentation

◆ names()

bool python_coverage_gate.PathAwareIgnore.names (   self,
  filename,
str  modulename 
)

Decide by full path whether a module is ignored.

Parameters
[in]filenameSource filename reported by the tracer.
[in]modulenameSource module name reported by the tracer.
Returns
True when ignored.

Definition at line 27 of file python_coverage_gate.py.

27 def names(self, filename, modulename: str) -> bool:
28 """!
29 @brief Decide by full path whether a module is ignored.
30 @param[in] filename Source filename reported by the tracer.
31 @param[in] modulename Source module name reported by the tracer.
32 @return True when ignored.
33 """
34 del modulename
35 if filename is None:
36 return True
37 normalized = os.path.normpath(filename)
38 return any(normalized.startswith(root + os.sep) for root in self._ignoredirs)
39
40

Field Documentation

◆ _ignoredirs

python_coverage_gate.PathAwareIgnore._ignoredirs
protected

Definition at line 25 of file python_coverage_gate.py.


The documentation for this class was generated from the following file: