Global Configuration

dnois.conf defines some constants used globally in DNOIS. They can be modified to change the behavior of DNOIS.

class dnois.conf.config(**configs)

A context manager to temporarily change global configurations.

>>> import dnois
>>> with dnois.config(float_print_fmt='.3f'):
...     print(dnois.fmt(1.23456789))
1.235
>>> print(dnois.fmt(1.23456789))
1.23457

Note

The usage of this class is similar to torch.no_grad(), which can serve as a context manager or a decorator.

Warning

The temporary changes made by this context manager is not thread-safe.

Parameters:

configs – Keyword arguments to change global configurations. Each key must be a valid configuration item name.

dnois.conf.detection_radius_eps: float = 1e-05

Expansion percentage of aperture radius when determining its passing region.

dnois.conf.edge_cutting: float = 1e-06

Reduction percentage of geo_radius when computing “extended value” of extended surfaces’ profiles.

dnois.conf.float_print_fmt: str = '.6g'

Default format to print float numbers.