Skip to content

Commit

Permalink
change default for debug mode in Config to False to reduce noise in o…
Browse files Browse the repository at this point in the history
…utputs
  • Loading branch information
maxeeem committed Nov 7, 2023
1 parent 337cc19 commit a0aa4bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions Tests/utils_for_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from pynars.Narsese._py.Term import Term
from pynars.NAL.MentalOperation import execute
from pynars.Narsese import Sentence, Judgement, Quest, Question, Goal
from pynars.Config import Config, Enable

nars = Reasoner(100, 100)
engine: GeneralEngine = nars.inference
Expand Down
11 changes: 7 additions & 4 deletions pynars/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Enable:
variable = True
anticipation = False
operation = False
debug = True
debug = False

class Config:
priority: float=0.8
Expand Down Expand Up @@ -102,14 +102,17 @@ def load(file_path: str):

valid = True
if not file_path.exists():
print(f"The file `{file_path}` does not exist.")
if Enable.debug:
print(f"The file `{file_path}` does not exist.")
valid = False
if file_path.suffix != '.json':
print(f"The file `{file_path}` should be `*.json`.")
if Enable.debug:
print(f"The file `{file_path}` should be `*.json`.")
valid = False
if not valid:
file_path = Path(__file__).parent/'config.json'
print(f'Loaded config file: {file_path}')
if Enable.debug:
print(f'Loaded config file: {file_path}')
try:
with open(file_path, 'r') as f:
content = json.load(f)
Expand Down

0 comments on commit a0aa4bf

Please sign in to comment.