Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ function meta::external::python::reversePCT::legendQL::pythonLegendQLReversesEss
// Cast -------------------------------------------------------------
[ // toDecimal
meta::pure::functions::math::tests::toDecimal::testDoubleToDecimal_Function_1__Boolean_1_->testRev(
noRev('|3.8->meta::pure::functions::math::toDecimal()')
rev('|3.8->meta::pure::functions::math::toDecimal()', 'c(3.8).to_decimal()')
),
meta::pure::functions::math::tests::toDecimal::testDecimalToDecimal_Function_1__Boolean_1_->testRev(
noRev('|3.8D->meta::pure::functions::math::toDecimal()')
rev('|3.8D->meta::pure::functions::math::toDecimal()', 'c(PythonDecimal(\'3.8\')).to_decimal()')
),
meta::pure::functions::math::tests::toDecimal::testIntToDecimal_Function_1__Boolean_1_->testRev(
noRev('|8->meta::pure::functions::math::toDecimal()')
rev('|8->meta::pure::functions::math::toDecimal()', 'c(8).to_decimal()')
)
]->combine(),
[ // toFloat
meta::pure::functions::math::tests::toFloat::testDecimalToFloat_Function_1__Boolean_1_->testRev(
noRev('|3.8D->meta::pure::functions::math::toFloat()')
rev('|3.8D->meta::pure::functions::math::toFloat()', 'c(PythonDecimal(\'3.8\')).to_float()')
)
]->combine()
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ function meta::external::python::reversePCT::legendQL::pythonLegendQLReversesEss
),
meta::pure::functions::math::tests::abs::testDecimalAbs_Function_1__Boolean_1_->testRev(
[
noRev('|meta::pure::functions::math::abs(-3.0D)'),
noRev('|3.0D->meta::pure::functions::math::abs()')
rev('|meta::pure::functions::math::abs(-3.0D)', 'abs(c(PythonDecimal(\'-3.0\')))'),
rev('|3.0D->meta::pure::functions::math::abs()', 'abs(c(PythonDecimal(\'3.0\')))')
]
)
]->combine(),
Expand Down Expand Up @@ -141,7 +141,7 @@ function meta::external::python::reversePCT::legendQL::pythonLegendQLReversesEss
),
meta::pure::functions::math::tests::rem::testRemWithDecimals_Function_1__Boolean_1_->testRev(
[
noRev('|3.14->meta::pure::functions::math::rem(1.5D)')
rev('|3.14->meta::pure::functions::math::rem(1.5D)', 'c(3.14).rem(PythonDecimal(\'1.5\'))')
]
),
meta::pure::functions::math::tests::rem::testRemInEval_Function_1__Boolean_1_->testRev(
Expand Down Expand Up @@ -250,8 +250,8 @@ function meta::external::python::reversePCT::legendQL::pythonLegendQLReversesEss
),
meta::pure::functions::math::tests::ceiling::testDecimalCeiling_Function_1__Boolean_1_->testRev(
[
noRev('|3.14D->meta::pure::functions::math::ceiling()'),
noRev('|meta::pure::functions::math::ceiling(-3.14D)')
rev('|3.14D->meta::pure::functions::math::ceiling()', 'c(PythonDecimal(\'3.14\')).ceil()'),
rev('|meta::pure::functions::math::ceiling(-3.14D)', 'math.ceil(c(PythonDecimal(\'-3.14\')))')
]
)
]->combine(),
Expand Down Expand Up @@ -284,8 +284,8 @@ function meta::external::python::reversePCT::legendQL::pythonLegendQLReversesEss
),
meta::pure::functions::math::tests::floor::testDecimalFloor_Function_1__Boolean_1_->testRev(
[
noRev('|3.14D->meta::pure::functions::math::floor()'),
noRev('|meta::pure::functions::math::floor(-3.14D)')
rev('|3.14D->meta::pure::functions::math::floor()', 'c(PythonDecimal(\'3.14\')).floor()'),
rev('|meta::pure::functions::math::floor(-3.14D)', 'math.floor(c(PythonDecimal(\'-3.14\')))')
]
)
]->combine(),
Expand Down Expand Up @@ -328,13 +328,12 @@ function meta::external::python::reversePCT::legendQL::pythonLegendQLReversesEss
),
meta::pure::functions::math::tests::round::testDecimalRound_Function_1__Boolean_1_->testRev(
[
noRev('|3.14159D->meta::pure::functions::math::round()'),
noRev('|meta::pure::functions::math::floor(-3.14D)'),
noRev('|3.14159D->meta::pure::functions::math::round(2)'),
noRev('|3.14159D->meta::pure::functions::math::round(3)'),
noRev('|meta::pure::functions::math::round(-3.14159D)'),
noRev('|meta::pure::functions::math::round(-3.14159D, 2)'),
noRev('|meta::pure::functions::math::round(-3.14159D, 3)')
rev('|3.14159D->meta::pure::functions::math::round()', 'c(PythonDecimal(\'3.14159\')).round()'),
rev('|3.14159D->meta::pure::functions::math::round(2)', 'c(PythonDecimal(\'3.14159\')).round(2)'),
rev('|3.14159D->meta::pure::functions::math::round(3)', 'c(PythonDecimal(\'3.14159\')).round(3)'),
rev('|meta::pure::functions::math::round(-3.14159D)', 'c(PythonDecimal(\'-3.14159\')).round()'),
rev('|meta::pure::functions::math::round(-3.14159D, 2)', 'c(PythonDecimal(\'-3.14159\')).round(2)'),
rev('|meta::pure::functions::math::round(-3.14159D, 3)', 'c(PythonDecimal(\'-3.14159\')).round(3)')
]
),
meta::pure::functions::math::tests::round::testFloatRoundWithScale_Function_1__Boolean_1_->testRev(
Expand Down Expand Up @@ -443,4 +442,4 @@ function meta::external::python::reversePCT::legendQL::pythonLegendQLReversesEss
]->combine()
// ------------------------------------------------------------------
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,27 +81,27 @@ function meta::external::python::reversePCT::legendQL::pythonLegendQLReversesEss
[ // parseDecimal
meta::pure::functions::string::tests::parseDecimal::testParseDecimal_Function_1__Boolean_1_->testRev(
[
noRev('|\'3.14159d\'->meta::pure::functions::string::parseDecimal()'),
noRev('|\'3.14159\'->meta::pure::functions::string::parseDecimal()'),
noRev('|\'-3.14159d\'->meta::pure::functions::string::parseDecimal()'),
noRev('|\'+0000003.1415900000\'->meta::pure::functions::string::parseDecimal()'),
noRev('|\'-0000003.1415900000\'->meta::pure::functions::string::parseDecimal()')
rev('|\'3.14159d\'->meta::pure::functions::string::parseDecimal()', 'c("3.14159d").parse_decimal()'),
rev('|\'3.14159\'->meta::pure::functions::string::parseDecimal()', 'c("3.14159").parse_decimal()'),
rev('|\'-3.14159d\'->meta::pure::functions::string::parseDecimal()', 'c("-3.14159d").parse_decimal()'),
rev('|\'+0000003.1415900000\'->meta::pure::functions::string::parseDecimal()', 'c("+0000003.1415900000").parse_decimal()'),
rev('|\'-0000003.1415900000\'->meta::pure::functions::string::parseDecimal()', 'c("-0000003.1415900000").parse_decimal()')
]
),
meta::pure::functions::string::tests::parseDecimal::testParseZero_Function_1__Boolean_1_->testRev(
[
noRev('|\'0.0\'->meta::pure::functions::string::parseDecimal()'),
noRev('|\'-000.000\'->meta::pure::functions::string::parseDecimal()')
rev('|\'0.0\'->meta::pure::functions::string::parseDecimal()', 'c("0.0").parse_decimal()'),
rev('|\'-000.000\'->meta::pure::functions::string::parseDecimal()', 'c("-000.000").parse_decimal()')
]
),
meta::pure::functions::string::tests::parseDecimal::testParseDecimalWithPrecisionScale_Function_1__Boolean_1_->testRev(
[
noRev('|\'123.126\'->meta::pure::functions::string::parseDecimal(5, 2)'),
noRev('|\'123.123\'->meta::pure::functions::string::parseDecimal(7, 3)'),
noRev('|\'-3.14159\'->meta::pure::functions::string::parseDecimal(5, 2)'),
noRev('|\'123.123\'->meta::pure::functions::string::parseDecimal(10, 5)'),
noRev('|\'+0000003.1415900000\'->meta::pure::functions::string::parseDecimal(38, 10)'),
noRev('|\'-0000003.1415900000\'->meta::pure::functions::string::parseDecimal(38, 10)')
rev('|\'123.126\'->meta::pure::functions::string::parseDecimal(5, 2)', 'c("123.126").parse_decimal(5, 2)'),
rev('|\'123.123\'->meta::pure::functions::string::parseDecimal(7, 3)', 'c("123.123").parse_decimal(7, 3)'),
rev('|\'-3.14159\'->meta::pure::functions::string::parseDecimal(5, 2)', 'c("-3.14159").parse_decimal(5, 2)'),
rev('|\'123.123\'->meta::pure::functions::string::parseDecimal(10, 5)', 'c("123.123").parse_decimal(10, 5)'),
rev('|\'+0000003.1415900000\'->meta::pure::functions::string::parseDecimal(38, 10)', 'c("+0000003.1415900000").parse_decimal(38, 10)'),
rev('|\'-0000003.1415900000\'->meta::pure::functions::string::parseDecimal(38, 10)', 'c("-0000003.1415900000").parse_decimal(38, 10)')
]
)
]->combine(),
Expand Down Expand Up @@ -354,4 +354,4 @@ function meta::external::python::reversePCT::legendQL::pythonLegendQLReversesEss
)
]->combine()
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ function meta::external::python::reversePCT::legendQL::pythonLegendQLReversesGra
),
meta::pure::functions::math::tests::divide::testDecimalDivide_Function_1__Boolean_1_->testRev(
[
noRev('|1.0D / 2.0'),
noRev('|1.1D / 2.1D')
rev('|1.1D / 2.1D', 'c(PythonDecimal(\'1.1\')) / PythonDecimal(\'2.1\')'),
rev('|1.0D / 2.0', 'c(PythonDecimal(\'1.0\')) / 2.0'),
rev('|((-4.0D) / 2.0) / 1', 'c(PythonDecimal(\'-4.0\')) / 2.0 / 1'),
rev('|((-4.0D) / 8) / 1.0', 'c(PythonDecimal(\'-4.0\')) / 8 / 1.0'),
rev('|(16D / 8) / 2.0', 'c(PythonDecimal(\'16\')) / 8 / 2.0'),
rev('|-(divide(3.1415D, 0.1D, 2))', '-(c(PythonDecimal(\'3.1415\')).divide(PythonDecimal(\'0.1\'), 2))')

]
)
]->combine(),
Expand Down Expand Up @@ -98,9 +103,9 @@ function meta::external::python::reversePCT::legendQL::pythonLegendQLReversesGra

meta::pure::functions::math::tests::minus::testDecimalMinus_Function_1__Boolean_1_->testRev(
[
noRev('|1.0D - 2.0D - 3.0D'),
noRev('|1.0D - 2 - 3.0'),
noRev('|(-4.0D) - 2.0D - 1')
rev('|1.0D - 2.0D - 3.0D', 'c(PythonDecimal(\'1.0\')) - c(PythonDecimal(\'2.0\')) - c(PythonDecimal(\'3.0\'))'),
rev('|1.0D - 2 - 3.0', 'c(PythonDecimal(\'1.0\')) - c(2) - c(3.0)'),
rev('|(-4.0D) - 2.0D - 1', 'c(PythonDecimal(\'-4.0\')) - c(PythonDecimal(\'2.0\')) - 1')
]
),

Expand Down Expand Up @@ -179,9 +184,9 @@ function meta::external::python::reversePCT::legendQL::pythonLegendQLReversesGra

meta::pure::functions::math::tests::plus::testDecimalPlus_Function_1__Boolean_1_->testRev(
[
noRev('|1.0D + 2.0D + 3.0D'),
noRev('|1.0D + 2.0 + 3'),
noRev('|(-4.0D) + 2.0D + 1')
rev('|1.0D + 2.0D + 3.0D', 'c(PythonDecimal(\'1.0\')) + c(PythonDecimal(\'2.0\')) + c(PythonDecimal(\'3.0\'))'),
rev('|1.0D + 2.0 + 3', 'c(PythonDecimal(\'1.0\')) + c(2.0) + c(3)'),
rev('|(-4.0D) + 2.0D + 1', 'c(PythonDecimal(\'-4.0\')) + c(PythonDecimal(\'2.0\')) + 1')
]
),

Expand All @@ -195,4 +200,4 @@ function meta::external::python::reversePCT::legendQL::pythonLegendQLReversesGra

]->combine()
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ function <<access.private>> meta::external::python::reversePCT::legendQL::getPur
let script =
'import math\n' +
'from datetime import date, datetime\n' +
'from pylegend.core.tds.tds_frame import FrameToPureConfig\n' +
'from decimal import Decimal as PythonDecimal\n' +
'from pylegend.core.tds.tds_frame import FrameToPureConfig\n' +
'from pylegend.core.language import PyLegendPrimitive\n' +
'from pylegend.core.language.shared.pct_helpers import c\n' +
'from pylegend.core.language.shared.functions import pi\n' +
Expand Down
Loading