Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# ──────────────────────────────────────────────
# CDISC Rules Engine — Environment Configuration
# ──────────────────────────────────────────────
# Copy this file to .env and fill in your values.

# Required for CORE command line execution (not used by cdisc-open-rules)
CDISC_LIBRARY_API_KEY=your_api_key_here

# Maximum dataset size in bytes before forcing Dask implementation
DATASET_SIZE_THRESHOLD=10485760

# Maximum number of issues per Excel sheet in the result report (default: 10000)
MAX_REPORT_ROWS=10

# Maximum errors to report per rule during a validation run.
# Format: (max_errors, per_dataset_flag)
# max_errors — integer cap on reported errors
# per_dataset_flag — if True, the cap applies per dataset; if False, across all datasets
MAX_ERRORS_PER_RULE=(10, True)

# ──────────────────────────────────────────────
# Study Configuration
# ──────────────────────────────────────────────

# Path to define.xml — absolute path, or filename if located in the same directory as .env
DEFINE_XML=define.xml

# Controlled terminology package
# see ./resources/cache for package names
# Format: <standard>ct-YYYY-MM-DD (e.g. sdtmct-2024-03-29)
CT=

# Standard product (e.g. sdtmig, adamig, sendig)
PRODUCT=

# Standard version, denoted with a dash (e.g. 3-4)
VERSION=

# TIG substandard
# SDTM, SEND, ADaM, or CDASH
SUBSTANDARD=

# TIG use case
# INDH, PROD, NONCLIN, or ANALYSIS
USE_CASE=
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ core.exe validate -rest -of -config -commands

---

**Note:** Setting `DATASET_SIZE_THRESHOLD=0` tells the engine to use Dask processing for all datasets regardless of size, size threshold defaults to 1/4 of available RAM so datasets larger than this will use Dask. See env.example to see what the CLI .env file should look like
**Note:** Setting `DATASET_SIZE_THRESHOLD=0` tells the engine to use Dask processing for all datasets regardless of size, size threshold defaults to 1/4 of available RAM so datasets larger than this will use Dask. See .env.example to see what the CLI .env file should look like

### Updating the Cache (`update-cache`)

Expand Down
7 changes: 7 additions & 0 deletions core.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,13 @@ def validate( # noqa
load_dotenv(dotenv_path)
validate_dataset_files_exist(dataset_path, logger, ctx)

if define_xml_path and dotenv_path and os.getenv("DEFINE_XML"):
dxp = Path(define_xml_path)
if not dxp.is_absolute() and dxp.parent == Path("."):
resolved = Path(dotenv_path).parent / define_xml_path
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I didn't know path had this slash operator

if resolved.is_file():
define_xml_path = str(resolved)

if not custom_standard:
standard = standard.lower()
supported_standards = StandardTypes.values()
Expand Down
10 changes: 0 additions & 10 deletions env.example

This file was deleted.

Loading