-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add files via upload #1029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
+143
−1,134
Open
Add files via upload #1029
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__all__ = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .cli import main | ||
if __name__ == '__main__': | ||
main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import argparse, json | ||
from .core import DividedByZeroAgent, DivInput | ||
|
||
def main(): | ||
p = argparse.ArgumentParser(prog="divided-by-zero") | ||
sub = p.add_subparsers(dest="cmd", required=True) | ||
|
||
run = sub.add_parser("run") | ||
run.add_argument("--a", type=float, required=True) | ||
run.add_argument("--b", type=float, required=True) | ||
|
||
def _run(args): | ||
agent = DividedByZeroAgent() | ||
inp = DivInput(a=args.a, b=args.b) | ||
res = agent.divide(inp) | ||
print(json.dumps(res.model_dump(), indent=2)) | ||
|
||
run.set_defaults(func=_run) | ||
|
||
args = p.parse_args() | ||
args.func(args) | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from pydantic import BaseModel, Field | ||
|
||
REFRAIN = -1 | ||
TEND = 0 | ||
AFFIRM = 1 | ||
|
||
class DivInput(BaseModel): | ||
a: float = Field(..., description="numerator") | ||
b: float = Field(..., description="denominator") | ||
|
||
class DivResult(BaseModel): | ||
result: float | ||
state: str | ||
|
||
class DividedByZeroAgent: | ||
def __init__(self): | ||
pass | ||
|
||
def divide(self, inp: DivInput) -> DivResult: | ||
try: | ||
res = inp.a / inp.b | ||
# classify ternary: <0 → REFRAIN, =0 → TEND, >0 → AFFIRM | ||
if res < 0: | ||
state = "REFRAIN" | ||
elif res == 0: | ||
state = "TEND" | ||
else: | ||
state = "AFFIRM" | ||
return DivResult(result=res, state=state) | ||
except ZeroDivisionError: | ||
# collapse into TEND (0) | ||
return DivResult(result=0, state="TEND") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pydantic==2.9.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"system_details_report": { | ||
"host_info": { | ||
"host_enabled": true, | ||
"location": "elisabetinergasse 25, top 10, graz, austria, skybase", | ||
https://maps.app.goo.gl/692okbbLj2DzscKr6 | ||
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d877.9040280724888!2d15.427564080381483!3d47.06934385195899!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x476e3576deb2fd91%3A0xde001f22c5ccc775!2sElisabethinergasse%2025%2C%208020%20Graz!5e1!3m2!1sen!2sat!4v1756567895708!5m2!1sen!2sat" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe> | ||
47.069116952452305, 15.427497770166003 | ||
https://heavy-heath-489.notion.site/25fa87cebd6f8053bcc0cf6c7b2fb659?pvs=73 | ||
https://github.com/eriirfos-eng/-ternlang/13/𒀯 | ||
"elevation_m": 355, | ||
"time": "01:07 (UTC -12:00)", | ||
"email": "eriirfos@gmail.com", | ||
"linkedin_profile": "in/simeon-kepp", | ||
"linkedin_company": "company/rfi-irfos", | ||
"osf_url": "https://osf.io/rzvyg", | ||
"orcid_url": "https://orcid.org/0009-0009-6922-9552" | ||
https://drive.google.com/drive/folders/13JqA7ldmoZgHmC2lYR73q4g4wRkanXaa?usp=sharing | ||
}, | ||
"operational_protocol": { | ||
"name": ""organic and digital intelligence and universial intelligence in the loop fallback",", | ||
"status": "active and canonical", | ||
"ternary_logic_roles": { | ||
"oi": "human (simeon)", | ||
"di": "host machine (hp zbook 15)", | ||
"ui": "canonical repository (github)" | ||
}, | ||
"primary_source": "https://github.com/eriirfos-eng/-ternlang/tree/459cfd0860183e6321e2e0371c614c50dc447db8/13/%F0%92%80%AF | ||
", | ||
https://colab.research.google.com/drive/1i7HO-SlG5scLUgGQdN-yZF-Zjp7A-hBM | ||
https://colab.research.google.com/drive/1i7HO-SlG5scLUgGQdN-yZF-Zjp7A-hBM?usp=sharing | ||
"version_control_system": "git", | ||
"database_role": "real-time state observation (not canonical source)" | ||
}, | ||
"report_details": { | ||
"date_generated": "2025年08月30日 13:07:27" | ||
}, | ||
"hardware_information": { | ||
"hardware_model": "Hewlett-Packard HP ZBook 15", | ||
"memory_gib": 8.0, | ||
"processor": "Intel® CoreTM i7-4800MQ ×ばつ 8", | ||
"graphics": "Intel® HD Graphics 4600 (HSW GT2)", | ||
"graphics_1": "NVE6", | ||
"disk_capacity_gb": 256.1 | ||
}, | ||
"software_information": { | ||
"firmware_version": "L70 Ver. 01.47", | ||
"os_name": "Ubuntu 24.04.2 LTS", | ||
"os_build": null, | ||
"os_type": "64-bit", | ||
"gnome_version": 46, | ||
"windowing_system": "Wayland", | ||
"kernel_version": "Linux 6.14.0-27-generic" | ||
} | ||
} | ||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from divided_by_zero.core import DividedByZeroAgent, DivInput | ||
|
||
def test_divide_normal(): | ||
agent = DividedByZeroAgent() | ||
res = agent.divide(DivInput(a=10, b=2)) | ||
assert res.state == "AFFIRM" | ||
|
||
def test_divide_zero(): | ||
agent = DividedByZeroAgent() | ||
res = agent.divide(DivInput(a=5, b=0)) | ||
assert res.result == 0 | ||
assert res.state == "TEND" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.