import sys import os # Add current directory to path so we can import from . (or just use module names) sys.path.append(os.path.dirname(__file__)) from phi.embed import encode_phi from phi.output import to_fastq, design_filtering_protocol def test(): equations = [ "x + y", "(a * b) + (c / d)", "x^2 + y^2 = z^2", "sin(x) + cos(y)", "sqrt(x + y) * 2", "", # Empty case ] print(f"{'Equation':<20} | {'DNA Sequence':<30} | {'Consistency Pass':<15}") print("-" * 70) for eq in equations: record = encode_phi(eq) if record: dna = record["dna_sequence"] pass_flag = "PASS" if record["consistency_pass"] else "FAIL" print(f"{eq:<20} | {dna:<30} | {pass_flag:<15}") else: print(f"{eq:<20} | {'None':<30} | {'N/A':<15}") # Test Output functions sample_record = encode_phi("(a + b) * c") if sample_record: print("\n--- FASTQ Example ---") print(to_fastq(sample_record)) print("--- PCR Protocol ---") print(design_filtering_protocol([sample_record])) if __name__ == "__main__": test()