lang
Hello. I am a new contributor. Say I am working on a new public method for a class, say, ExceptionUtils.java. What value do I put in the @since field in the JavaDoc of this method? Thank you for your time
Re: [commons-lang] branch master updated: [LANG-1647] Add and ExceptionUtils.isChecked() and isUnchecked() #1069
Hi Elliotte. I never thought of that, but I don't think it is Apache's problem if people exit the java convention On Mon, 3 Jul 2023, 01:02 Elliotte Rusty Harold, wrote: > On Sun, Jul 2, 2023 at 8:53 PM Alex Herbert > wrote: > > > public static boolean isUnchecked(final Throwable throwable) { > > return (throwable instanceof Error) || (throwable instanceof > > RuntimeException); > > } > > Not quite. It's also possible for someone to define a subclass of > Throwable directly that is neither an Exception nor an Error. > > > -- > Elliotte Rusty Harold > elh...@ibiblio.org > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
Re: [commons-lang] branch master updated: [LANG-1647] Add and ExceptionUtils.isChecked() and isUnchecked() #1069
I just noticed that the line return !isChecked(throwable) Means that if throwable is null then it will be considered unchecked. I will fix that tomorrow by doing Return throwable ! null && throwable instanceof Exception; On Mon, 3 Jul 2023, 01:20 Gary Gregory, wrote: > Hi Elliotte: > > Might you be looking at some old code in the PR? > > The current code is: > > /** > * Checks if a throwable represents a checked exception > * > * @param throwable > *The throwable to check. > * @return True if the given Throwable is a checked exception. > * @since 3.13.0 > */ > public static boolean isChecked(final Throwable throwable) { > return throwable != null && !(throwable instanceof Error) && > !(throwable instanceof RuntimeException); > } > > /** > * Checks if a throwable represents an unchecked exception > * > * @param throwable > *The throwable to check. > * @return True if the given Throwable is an unchecked exception. > * @since 3.13.0 > */ > public static boolean isUnchecked(final Throwable throwable) { > return !isChecked(throwable); > } > > Gary > > On Sun, Jul 2, 2023 at 8:01 PM Elliotte Rusty Harold > wrote: > > > > On Sun, Jul 2, 2023 at 8:53 PM Alex Herbert > wrote: > > > > > public static boolean isUnchecked(final Throwable throwable) { > > > return (throwable instanceof Error) || (throwable instanceof > > > RuntimeException); > > > } > > > > Not quite. It's also possible for someone to define a subclass of > > Throwable directly that is neither an Exception nor an Error. > > > > > > -- > > Elliotte Rusty Harold > > elh...@ibiblio.org > > > > - > > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > > For additional commands, e-mail: dev-h...@commons.apache.org > > > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
Re: [commons-lang] branch master updated: [LANG-1647] Add and ExceptionUtils.isChecked() and isUnchecked() #1069
yes. You are right. Closed On Mon, 3 Jul 2023 at 10:12, Gilles Sadowski wrote: > Le lun. 3 juil. 2023 à 09:41, Alex Herbert a > écrit : > > > > On Mon, 3 Jul 2023 at 08:29, sebb wrote: > > > > > > Is null checked or unchecked? > > > > > > I think neither, so isUnchecked also needs to check for null. > > > > > > I wonder whether it might be better to throw NPE in both cases for > null. > > > > > > It may be confusing for users if not checked != unchecked. > > > e.g. it is tempting to code: > > > > > > if (isChecked(t)) { > > > } else { // must be unChecked > > > } > > > > > > If we don’t throw NPE, then it needs to be made very clear that > > > isChecked and isUnchecked are not opposites, there is a 3rd case. > > > > > > In any case, there needs to be a unit-test specifically for null. > > > > > > Sebb > > > > +1 > > > > I reiterate what I originally said, this is missing: > > > > @Test > > public void testIsUnchecked_null() { > > assertFalse(ExceptionUtils.isUnchecked(null)); > > } > > > > The method implementation details are secondary to the fact that the > > code is not clear on how it handles null; the relationship between > > isChecked and isUnchecked; and the intended usage. > > > > Note that one possible usage of type determination is to decide if you > > can cast it to a certain type. Currently this method does not provide > > this functionality as isUnchecked does not ensure that a cast to > > RuntimeException is allowed (since it passes for Error). So my use > > case is satisfied by instanceof. This leaves me wondering what are the > > use cases for isChecked or isUnchecked. I presume you are in an > > exception block with a Throwable of unknown type. So why do you care > > if the exception is not checked if not for a recast? > > > > Without a use case not satisfied by instanceof then this is code bloat. > > > > Reading through the discussion, I was wondering the same (What is > the use case?) and was tempted to reach the same conclusion. > After all, isn't "try/catch" the standard way to tailor behaviour according > to the exception type? > > Regards, > Gilles > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
Is there a need for any of these math functions?
GetOrderOfMagnitudeOfNumber. For x < 10 => 0. For x = 10 => 1. For x = 1000 => 3, etc. GetDivisorsOfNumber. For x = 1 => [1]. For x = 20 => [2, 5] GetNumberOfDivisors GetGreatestCommonDivisorOf2NumbersBasedOnTheirFactors i.e. public static ANumber getGreatestCommonDivisorOf2NumbersBasedOnTheirFactors(List factorsOfX, List factorsOfY) { factorsOfX.retainAll(factorsOfY); Set commonFactors = new HashSet(factorsOfX); List commonFactors1 = new ArrayList(commonFactors); Collections.sort(commonFactors1); return commonFactors1.get(commonFactors1.size() - 1); } AreCommensurable i.e. public static boolean areCommensurable(int x, int y, int z) { return isMultipleOf(x, z) && isMultipleOf(y, z); } GetNumberOfDecimalDigitsOfNumber i.e. public static int run(double x, int precision) { String xTemp = Double.toString(x); return Math.min(xTemp.substring(xTemp.indexOf(".") + 1).length(), precision); }
[batch2] is there a need for any of these functions?
DivideAndRemainder which returns a pair of quotient and remainder GetSineInDegrees which converts the input from radians to degrees and then does Math.sin(x) GetCosineInDegrees which converts the input from radians to degrees and then does Math.cos(x) GetTangentInDegrees which converts the input from radians to degrees and then does Math.tan(x) GetNthRoot of an integer GetNeperianLogarithm Exponentiate(x, y) which is x^y where x and y can be any combination of int, long, double, Complex, etc. GetPowerOf2GreaterOrEqualTo(x) i.e. SomePowerOf2 >= x GetSumOfDigits GetSumOfSquares(List numbers) public static Number[] GetCumulativeSum(Number[] numbers) public static Number[] GetCumulativeSumOfSquares(Number[] numbers) AddNumbersWithWeightsTask i.e. double sum = 0.0d; IntStream.range(0, numbers.size()).forEach(i -> sum + (numbers.get(i) * weights.get(i))); GetEToThePowerOf i.e. e^x GetIntegralRoot GetJordanProduct GetWeightedArithmeticAverage(List numbers, List weights) GetGeometricAverage GetHarmonicAverage GetQuadraticAverage interval arithmetic (part of computational mathematics)
[batch3] is there a need for any of these functions?
public static Function1x1 differentiate(Function1x1 f) i.e. take x^2 and return the function 2x, not 2x(x0) public static Function1x1 differentiate(Function1x1 f, int orderOfDerivative) i.e. take x^3 and return the function 6x, not 6x(x0) public static Function2x1 getPartialDerivativeOnX(Function2x1 f) i..e take x^2 + 4y and return the function 2x + 4y public static Function2x1 getPartialDerivativeOnY(Function2x1 f) i..e take x^2 + 4y and return the function x^2 + 4 SolveFirstOrderOrdinaryDifferentialEquationUsingEulerMethod getNumberOfCombinationsWithElementRepetition(Number n, Number r) GetPascalTriangle GetStirlingNumberOfFirstKind getStirlingNumberOfSecondKind etNumberOfOrderedSelections(Number numberOfItems, Number sizeOfEachSelection) getNumberOfWaysToChooseWithReplacementInAnyOrder(Number numberOfItems, Number sizeOfEachSelection) getNumberOfMPartCompositionsOfN(Number n, Number m) GetNumberOfCompositionsOfN GetExtendedBinomialCoefficient getError(Number realValue, Number approximateValue) getAbsoluteError(Number realValue, Number approximateValue) getRelativeError(Number realValue, Number approximateValue) getPercentError(Number realValue, Number approximateValue) getErrorSquared(Number realValue, Number approximateValue) getSumOfSquaredErrors(Vector realValues, Vector approximateValues) getMeanSquaredError(Vector realValues, Vector approximateValues) PolynomialFunction object using Java util functions Function object using Java util functions that can represent any function and do symbolic math on it
[batch4] is there a need for any of these functions?
getNumberOfParallelogramsFormedByPoints(Point[] points) getMinimumNumberOfLinesThatGoThroughPoints(Point pointAllLinesToPassThrough, Point[] points) getManhattanDistance(Point point1, Point point2) getNumberOfHorizontalOrVerticalLineSegmentsToConnectPoints(Point point1, Point point2, Point point3) getMinimumDistanceBetweenLineAndPointIn3D(Point linePoint1, Point linePoint2, Point point) getAreaOfParallelogramGiven2AdjacentSides(Vector x, Vector y) getDistanceFromPoint(Plane plane, Point point) getAngleWithPlane(Plane x, Plane other) isPlaneParallelTo(Plane x, Plane other) getDistanceFromParallelPlane(Plane x, Plane other) areCoplanar(Point... points) getFootOfPerpendicularLineFromPoint(Plane x, Point point) arePointsCollinear(Point... points) arePointsCoplanar(Point... points) getClosestPairOfPoints(Point[] points) getDistanceOfClosestPairOfPoints(Point[] points) getFarthestPairOfPoints(Point[] points) getOrientation(Point p, Point q, Point r) getNumberOfLatticePointsBetween(Point p, Point other) getNumberOfLatticePointsBetweenIncludingGivenPoints(Point p, Point other) getNumberOfIntegralPointsBetween(Point p, Point other) getNumberOfIntegralPointsBetweenIncludingGivenPoints(Point p, Point other) reflectAboutALineSegment(Point p, LineSegment lineSegment) reflectAboutALine(Point p, Line line) translate(Point p, Number x) getDistanceFromLine(Point p, Line line) doesPointLieOnTheLeftOfLineSegment(Point point, LineSegment lineSegment) doesPointLieOnTheRightOfLineSegment(Point point, LineSegment lineSegment) reflectAboutAPlane(Point point, Plane plane) getHammeredDistanceBetweenPoints(Point... points) getCircumference(Circle x) getArea(Circle x) isPointInsideCircle(Circle x, Point other) isPointOnCircle(Circle x, Point other) getNumberOfLatticePoints(Circle x) getPositiveYBasedOnX(Circle circle, Number x) getNegativeYBasedOnX(Circle circle, Number x) getAngleAsRadiansBetween(Circle x, Point startPoint, Point endPoint) getCirclePointBasedOn(Circle x, Point startPoint, Number angle) getNumberOfAreasBasedOnNumberOfCuts(Number cuts) isLineTangentToCircle(Circle x, Line line) doesLineIntersectCircle(Circle x, Line line) isLineTangent(Circle x, Line line) isLineSecant(Circle x, Line line) getAreaOfMinorSegment(Circle x, CircleChord chord) getAreaOfMajorSegment(Circle x, CircleChord chord) doCirclesIntersect(Circle x, Circle other) getTangentLineOnPoint(Circle x, Point point) getCircleThatEnclosesPoints(List points) getArcLength(CircleArc arc) isPointOnArc(CircleArc arc, Point point) getAreaFormedByArc(CircleArc arc) getChordLength(CircleChord chord) isPointOnChord(CircleChord chord, Point point) isDiameter(CircleChord chord) getSurfaceArea(Cube x) getVolume(Cube x) getFaceDiagonal(Cube x) getSpaceDiagonal(Cube x) getCylinderSurfaceArea(Cylinder x) getCylinderVolume(Cylinder x) isMajorAxisParallelToXAxis(Ellipse x) getEllipseArea(Ellipse x) getEllipseCircumference(Ellipse x) getDistanceFromPoint(Line line, Point point) doesIntersect(Line x, Line other) getIntersectionPoint(Line x, Line other) getPointThatMinimisesSumOfdistancesFromPointsToLine(Line x, Point[] points) getPointThatMinimisesSumOfdistancesFromPointsToLine(Line x, Point[] points, int precision) getLineThatBestFitsPoints(List points) isLineParallelTo(Line x, Line other) isLineVerticalTo(Line x, Line other) isLineTangentToCircle(Line x, Circle circle) doesLineIntersectCircle(Line x, Circle circle) isPointInsidePolygon(Polygon polygon, Point point) getConvexHull(Point[] points) getMinimumCostOfTriangulation(Polygon polygon) getPolygonPerimeter(Polygon polygon) getPolygonArea(Polygon polygon) getPerimeter(Rectangle x) getArea(Rectangle x) isPointInsideRectangle(Rectangle x, Point other) isPointOnRectangle(Rectangle x, Point other) doesRectangleOverlapWith(Rectangle x, Rectangle other) getRectangleCornerPointsUsing4LineSegments(LineSegment s1, LineSegment s2, LineSegment s3, LineSegment s4) doLineSegmentsFormRectangle(LineSegment s1, LineSegment s2, LineSegment s3, LineSegment s4) getLengthOfDiagonal(Rectangle x) getCircumradius(Rectangle x) getSphereArea(Sphere x) getSphereVolume(Sphere x) isPointInsideSphere(Sphere x, Point point) isPointOnSphere(Sphere x, Point point) getTrianglePerimeter(Triangle x) getTriangleArea(Triangle x) getAreaGiven2AdjacentSides(Vector x, Vector y) getHypotenuse(ANumber sideLength1, ANumber sideLength2) isPointOnTriangle(Triangle x, Point other) isPointInsideTriangle(Triangle x, Point other) getNumberOfLatticePoints(Triangle x) getNumberOfIntegralPoints(Triangle x) getSideType(Triangle x) getAngleType(Triangle x) getNumberOfSquaresThatCanFitInRightIsoscelesTriangle(Triangle x, Number squareSideLength) getLengthOfSideUsingLawOfCosines(Number lengthOfSide1, Number lengthOfSide2, Number cosineOfSide1AndSide2) getCosineBetweenSidesB
[batch5] is there a need for any of these functions?
convertDegreesToRadians(Number x) convertRadiansToDegrees(Number x) normaliseRadians(Number x) isEquivalentTo(Vector x, Vector y) multiplyComponentWise(Vector x, Vector y) normalise(Vector x) translate(Vector x, Number translationLength) reverseDirection(Vector x) getDisplacementVector(Point point1, Point point2) getBasisVector(int dimensions, Axis axis) getVectorComponent(Vector x, Axis axis) getVectorComponents(Vector x) getCosineWithXAxis(Vector x) getCosineWithAxis(Vector x, Axis axis) getAngleWithVector(Vector x, Vector y) getAngleWithXAxis(Vector x) getAngleWithAxis(Vector x, Axis axis) isPerpendicularTo(Vector x, Vector y) isParallelTo(Vector x, Vector y) getLengthOfProjectionOntoVector(Vector x, Vector y) getProjectionOntoVector(Vector x, Vector y) getTripleScalarProduct(Vector x, Vector y, Vector z) getDistanceFrom(Vector x, Vector y) getStandardBasis(int dimensions) isCodirectionalTo(Vector x, Vector y) isAntidirectionalTo(Vector x, Vector y) getEqualVectorBasedOnPoint(Vector x, Point point) areVectorsLinearlyDependent(List vectors) areVectorsLinearlyIndependent(List vectors) isOrthonormalTo(Vector x, Vector y) areVectorsOrthonormal(List vectors) isPointBetweenVectorEndPoints(Vector x, Point point) divideVectorWithRatio(Vector x, Number ratio) getMidpoint(Vector x) convertToMatrix(Vector x) getLengthOfLongestIncreasingSubsequence(Vector x) getLengthOfLongestDecreasingSubsequence(Vector x) getLengthOfLongestStableSubsequence(Vector x) getFirstIndexOfMinimum(Vector x) getLastIndexOfMinimum(Vector x) getFirstIndexOfMaximum(Vector x) getLastIndexOfMaximum(Vector x) getCumulativeSum(Vector x) getCumulativeProduct(Vector x) getReverseCumulativeSum(Vector x) getReverseCumulativeProduct(Vector x) getDifferencesBetweenSuccessiveElements(Vector x) areAtEquilibrium(Vector... vectors) sortAndMapTogether(Vector x, Vector y) normaliseFrom0To1(Vector x) flattenVectors(List vectors) getTheFirstNLargestElementsSorted(Vector x, int n) getTheFirstNSmallestElementsSorted(Vector x, int n) getIndicesOfOccurenceOfElement(Vector x, ANumber element)
[batch7] is there a need for any of these functions?
getNumberOfNonZeroDiagonalElements(Matrix x) getDiagonal(Matrix x) getRank(Matrix x) getSubmatrix(Matrix x, int fromRow, int toRow, int fromColumn, int toColumn) negate(Matrix x) isZeroMatrix(Matrix x) isIdentityMatrix(Matrix x) getUpperTriangularPart(Matrix x) getLowerTriangularPart(Matrix x) swapRows(Matrix x, int row1, int row2) swapColumns(Matrix x, int column1, int column2) exponentiate(Matrix x, int exponent) getExponentForMatrixToBeNilpotent(Matrix x) augmentWith(Matrix x, Vector y) isSingular(Matrix x) isInvertible(Matrix x) isSymmetric(Matrix x) isSkewSymmetric(Matrix x) isAntiSymmetric(Matrix x) isOrthogonal(Matrix x) isUnitary(Matrix x) isNormal(Matrix x) isHermitian(Matrix x) isAntihermitian(Matrix x) isBinary(Matrix x) isCMatrix(Matrix x) isIntegerMatrix(Matrix x) isSpecialMatrix(Matrix x) isUnitMatrix(Matrix x) isCompatibleWith(Matrix x, Vector vector) isCentrosymmetric(Matrix x) isBisymmetric(Matrix x) isCirculantMatrix(Matrix x) isCommutativeWith(Matrix x, Matrix other) isCoxeterMatrix(Matrix x) isDiagonallyDominant(Matrix x) isDoublyStochastic(Matrix x) isFibonacciQMatrix(Matrix x) isUpperHessenbergMatrix(Matrix x) isLowerHessenbergMatrix(Matrix x) isHessenbergMatrix(Matrix x) isHankelMatrix(Matrix x) isHilbertMatrix(Matrix x) isInvolutoryMatrix(Matrix x) isJordanBlock(Matrix x) isKMatrix(Matrix x) isKacMatrix(Matrix x) isClementMatrix(Matrix x) isMonotonicMatrix(Matrix x) isPeriodicMatrix(Matrix x) getMatrixPeriod(Matrix x) isSquareMatrix(Matrix x) isRectangularMatrix(Matrix x) isRedhefferMatrix(Matrix x) isScalarMatrix(Matrix x) isSpecialOrthogonalMatrix(Matrix x) isSpecialUnitaryMatrix(Matrix x) isStochasticMatrix(Matrix x) isRightStochasticMatrix(Matrix x) isLeftStochasticMatrix(Matrix x) isTriangularMatrix(Matrix x) isTridiagonalMatrix(Matrix x) isUnimodularMatrix(Matrix x) isVandermondeMatrix(Matrix x) getConjugateTranspose(Matrix x) getAdjoint(Matrix x) isSelfAdjoint(Matrix x) getTrace(Matrix x) getInverse(Matrix x) getCondition(Matrix x) rotate90DegreesClockwise(Matrix x) getCumulativeSumForRows(Matrix x) getCumulativeSumForColumns(Matrix x) getCumulativeProductForRows(Matrix x) getCumulativeProductForColumns(Matrix x) getDifferencesBetweenSuccessiveRowElements(Matrix x) getDifferencesBetweenSuccessiveColumnElements(Matrix x) getMinor(Matrix x, int rowToExclude, int columnToExclude) getBandwidth(Matrix x) getHadamartMatrix(int order) normalise(Matrix x) normaliseFrom0To1(Matrix x) ArithmeticProgressionSequence GeometricProgressionSequence FibonacciSequence other sequence functions
[batch8] is there a need for any of these functions?
getUnion(Set other) getIntersection(Set other) getDifference(Set other) getSymmetricDifference(Set other) isSubset(Set other) isProperSubset(Set other) getTruthSetFor(Predicate filterToApply) getSizeOfPowerset() getPowerset() isDisjointTo(Set other) getComplementRelativeTo(Set other) getCardinality() getMinimum() getMaximum() isBounded() getNumberOfSubsetsTheSetHas() getNumberOfDerangements() multiset functions
Are any of these types of projects needed?
Java-based ECommerce platform Graph and network theory library Operations research or management science or mathematical programming library Calendar library with many useful methods that the java datetime API doesn't provide off-the-shelf Finance library including financial engineering User management (not apache shiro) i.e. account management, 2-factor auth, forgot/reset password, security questions and more Web utilities from cookie service to device recognition to email service and more Image manipulation library Parallelism library for CPU and GPU parallelism Quantum computing library AdminTool platform. Imagine grafana, but with a lot of prebuilt and extensible tools Physics library Client SDK builder by taking API specs and generating java SDKs, JavaScript SDKs, python etc. Transformer of MySQL data to MongoDB and vice-versa. Same for other kinds of databases Blockchain library Query Profiling Plugin: A plugin that tracks and logs all database queries that are executed by the application. It could highlight inefficient queries, and also track and display query execution times. Health Check Plugin: A plugin to perform various health checks on the application and its dependencies, such as checking database connectivity, ensuring required services are running, checking disk space, etc. This plugin can expose health check endpoints that return the status of your application and its dependencies. This can be useful for monitoring and automated deployment scenarios. Scheduled Tasks Monitoring Plugin: This plugin could provide a unified view of all the scheduled tasks in your application and provide information like when each task last ran, whether it completed successfully, and when it's due to run next. Event Sourcing Plugin: A plugin that makes it easier to implement the event sourcing pattern in a Spring application. It would help manage the event store and the rehydration of application state from events. Application Metadata Plugin: A plugin that generates and exposes metadata about the application, like the version number, build date, list of active profiles, etc. Data Integrity Plugin: A plugin that helps ensure data integrity by checking for anomalies such as orphaned records, duplicate entries, etc. Test Data Generation Plugin: This plugin could auto-generate test data for unit and integration tests, using predefined rules to ensure the data is meaningful and useful for testing. Telemetry Filter: A filter that collects telemetry data such as request counts, error counts, and more, which can be useful for monitoring and diagnostics.
Re: Are any of these types of projects needed?
The intended audience is the devs on this maillist. It is like market research to get the pulse of the community on these ideas to see if there is at least one that I could apply for in the incubator. No, i am not working on all of these. I just presented ideas so that I get some feedback. Maybe some people will say: "yes, an open source java-based eCommerce platform will be in demand", you know? Same with the other emails about math functions. Maybe some people from math or non-math commons libraries may point out that they would need some of those functions. Lastly, are there any math libraries that do symbolic math using functional interfaces? For example can I use commons math to give it a function that represents x^2, differentiate it and as a result get another function that represents 2x? I am talking about symbolic math that Wolfram Mathematica does. Thank you for the time you spent on going through the emails. I did some pull requests implementing some things and they kept being rejected. So, (i think it was you that suggested it) to ask the community which math functions they would like to see implemented On Fri, 14 Jul 2023, 02:03 Gilles Sadowski, wrote: > Dimitrios, > > As requested several times, could you please add the "component" > prefix to the "Subject: " line, to signal to the intended audience? > > What's the purpose of the list below? > Are you developing all of those applications? > > Regards, > Gilles > > Le ven. 14 juil. 2023 à 02:54, Dimitrios Efthymiou > a écrit : > > > > Java-based ECommerce platform > > > > Graph and network theory library > > > > Operations research or management science or mathematical programming > > library > > > > Calendar library with many useful methods that the java datetime API > > doesn't provide off-the-shelf > > > > Finance library including financial engineering > > > > User management (not apache shiro) i.e. account management, 2-factor > auth, > > forgot/reset password, security questions and more > > > > Web utilities from cookie service to device recognition to email service > > and more > > > > Image manipulation library > > > > Parallelism library for CPU and GPU parallelism > > > > Quantum computing library > > > > AdminTool platform. Imagine grafana, but with a lot of prebuilt and > > extensible tools > > > > Physics library > > > > Client SDK builder by taking API specs and generating java SDKs, > JavaScript > > SDKs, python etc. > > > > Transformer of MySQL data to MongoDB and vice-versa. Same for other kinds > > of databases > > > > Blockchain library > > > > Query Profiling Plugin: A plugin that tracks and logs all database > queries > > that are executed by the application. It could highlight inefficient > > queries, and also track and display query execution times. > > > > Health Check Plugin: A plugin to perform various health checks on the > > application and its dependencies, such as checking database connectivity, > > ensuring required services are running, checking disk space, etc. This > > plugin can expose health check endpoints that return the status of your > > application and its dependencies. This can be useful for monitoring and > > automated deployment scenarios. > > > > Scheduled Tasks Monitoring Plugin: This plugin could provide a unified > view > > of all the scheduled tasks in your application and provide information > like > > when each task last ran, whether it completed successfully, and when it's > > due to run next. > > > > Event Sourcing Plugin: A plugin that makes it easier to implement the > event > > sourcing pattern in a Spring application. It would help manage the event > > store and the rehydration of application state from events. > > > > Application Metadata Plugin: A plugin that generates and exposes metadata > > about the application, like the version number, build date, list of > active > > profiles, etc. > > > > Data Integrity Plugin: A plugin that helps ensure data integrity by > > checking for anomalies such as orphaned records, duplicate entries, etc. > > > > Test Data Generation Plugin: This plugin could auto-generate test data > for > > unit and integration tests, using predefined rules to ensure the data is > > meaningful and useful for testing. > > > > Telemetry Filter: A filter that collects telemetry data such as request > > counts, error counts, and more, which can be useful for monitoring and > > diagnostics. > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
[math] refactoring math4
Hello devs. I need a little help. 1--Say that I want to implement a new feature/function that, technically exists in the math4 or legacy, but it doesn't exist in commons- geometry or commons- numbers. What is the protocol? Do we create a ticket on math4 and put the new code in math4 and ignore the geometry/numbers projects? 2--Can contributors remove code from math4 and move it to the other new math projects? I see in GitHub for commons-math it says: "Functionality still within "Commons Math" is gradually being modularized and refactored". Is there documentation that explains the precise way math4 should be refactored and modularised and who is allowed to even touch math4 and move functionality out of the library? 3–Are the math-related projects (like numbers and geometry) final? For example, where is calculus gonna go? Is there gonna be a new project like commons-calculus? Same question for other math theories. 4--Are the submodules of the numbers and geometry projects final? Geometry has the commons-geometry-euclidean module and a few more. Will there be new modules added to the math-related projects, as time passes?
[statistics] move code from math4.stat to commons-statistics
hello everyone. I noticed that the common-statistics-descriptive module has no code. Does that mean that we should start moving classes from \commons-math\commons-math-legacy\src\main\java\org\apache\commons\math4\legacy\stat\descriptive to \commons-statistics\commons-statistics-descriptive\src\main\java\org\apache\commons\statistics\descriptive? thank you
[statistics] move code from math4.stat.regression to commons-statistics-regression
hello everyone. I noticed that the common-statistics-regression module has no code. Does that mean that we should start moving classes from \commons-math\commons-math-legacy\src\main\java\org\apache\commons\math4\legacy\stat\ regression to \commons-statistics\commons-statistics-descriptive\src\main\java\org\apache\commons\statistics\ regression ? thank you
Move math algorithms from all projects to math libraries
Hello everyone. One thing i would love to do is to go through the apache projects, see which ones already depend on the math library, and see if they implement some math stuff that could be replaced by a call to commons math or move that function to the math library. Would such cases be considered valid for implementing new math algorithms inside the math libraries? I don't think i have seen any ticket that wants to implement new math algorithms. Thank you
Re: Move math algorithms from all projects to math libraries
I didn't say to introduce a dependency on math. I said that libraries that already depend on math, may have math algorithms implemented that we could replace with a call to the appropriate commons math methods or if math doesn't have those math algorithms, we can move them to math. Flink and HBase for example depend on math On Mon, 17 Jul 2023, 01:08 Gary Gregory, wrote: > At one point, I had proposed to deprecate Commons Lang' math package in > favor of something else in Commons Math or elsewhere. Commons Lang would > NOT depend on Commons Math/Other, we would just deprecate with a forwarding > link. > > This idea was rejected IIRC because I do not think there was agreement on > where to put what. I think the Lang Fraction class for example is not a > match for the one in Math or Numbers or wherever it is. > > One thing to keep in mind it's OK to fill in the gaps in one component > (Math, Numbers, and so on) but that does not automatically mean that a > dependency will be introduced. For example, it would be odd for Lang or IO > to depend on Math. > > Gary > > On Sun, Jul 16, 2023, 19:55 Dimitrios Efthymiou < > efthymiou.dimitri...@gmail.com> wrote: > > > Hello everyone. > > One thing i would love to do is to go through the apache projects, see > > which ones already depend on the math library, and see if they implement > > some math stuff that could be replaced by a call to commons math or move > > that function to the math library. Would such cases be considered valid > for > > implementing new math algorithms inside the math libraries? I don't > think i > > have seen any ticket that wants to implement new math algorithms. > > > > Thank you > > >
Is there a need for a commons-physics project?
Re: Move math algorithms from all projects to math libraries
I don't have specific functionality in mind. I just had an idea to do a search for dependencies on java.lang.Math or BigInteger or BigDecimal and if I find any, I would see if these dependencies exist because the project has its own custom math algorithms. If yes then, there you go. We have something to replace by utilising the commons math libraries. I haven't done a search yet. I wanted to see if the community would be OK with new tickets (if any) for new functionality to be implemented in the math libraries, GIVEN that there will automatically be use-cases i.e. apache already uses those algorithms. When I suggest new math functionality, I am always asked what the use-cases are and I don't have any, because I just want to implement unimplemented math algorithms. So, I thought that this way (if I find any) there will be use-cases On Mon, 17 Jul 2023 at 11:43, Gilles Sadowski wrote: > Le lun. 17 juil. 2023 à 02:34, Dimitrios Efthymiou > a écrit : > > > > I didn't say to introduce a dependency on math. I said that libraries > that > > already depend on math, may have math algorithms implemented that we > could > > replace with a call to the appropriate commons math methods > > Sounds nice. > If we could already do that just within "Commons"... (see other post). > > > or if math > > doesn't have those math algorithms, we can move them to math. Flink and > > HBase for example depend on math > > For which functionality? > > Regards, > Gilles > > >> [...] > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
Re: Move NO algorithms from ANY projects to math libraries
hello. I never said to redesign APIs. I only said that we can move math algorithms from non-math projects, to the math projects On Mon, 17 Jul 2023 at 11:50, Elliotte Rusty Harold wrote: > There are a lot of proposals floating recently to churn the API. I'm > going to move a direct no on all of this. > > Mild improvements in consistency in no way justify any API breakage or > even deprecation. Every method and class that currently exists in any > commons library should continue to exist there with the same signature > indefinitely. Compatibility is far more important than consistency. Do > NOT redesign or rethink the APIs at this late date. Too much depends > on them. > > New methods, classes, and packages, and projects can be added where > appropriate. Internals can be improved as possible. But what's there > today stays there, absent the very rare case where critical bugs or > security issues require breaking an API. However, that's extremely > uncommon. > > No API will ever be perfect or free from hindsight. But the cost of > change is too high to justify breaking commons libraries. Stare > decisis is as valuable a principle in API design as in law. > > -- > Elliotte Rusty Harold > elh...@ibiblio.org > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
Re: Move NO algorithms from ANY projects to math libraries
Nothing will change then. Agreed. If you have a class MathUtils and a method add(double... numbers) then keep it, but replace the body if the method with the call to commons-numbers, for example. That's what I mean On Mon, 17 Jul 2023, 14:31 Elliotte Rusty Harold, wrote: > On Mon, Jul 17, 2023 at 9:21 AM Dimitrios Efthymiou > wrote: > > > > hello. I never said to redesign APIs. I only said that we can > > move math algorithms from non-math projects, to the math projects > > > > No, don't do that. > > Method signatures must not change. > Class names must not change. > Package names must not change. > Group and artifact IDs must not change. > Split packages are not allowed. > > -- > Elliotte Rusty Harold > elh...@ibiblio.org > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
Re: Move math algorithms from all projects to math libraries
All i am saying is that if HBase has a class, say MathUtils and a method add(double... numbers) and its body has the math algorithm to do addition, we can just replace the method body with a call to the appropriate math class that does addition. That's all i am saying. HBase, for example already depends on math. I am not saying, change the API of HBase. Just extract whatever math algorithms HBase has, put them in math (if they don't exist there already) and call math. I don't have specific examples in mind, but i know a few projects that already depend on math like https://github.com/apache/pinot/blob/master/pom.xml https://github.com/apache/flink/blob/master/pom.xml https://github.com/apache/hbase/blob/master/pom.xml https://github.com/apache/drill/blob/master/pom.xml https://github.com/apache/accumulo/blob/main/pom.xml https://github.com/apache/hive/blob/master/pom.xml https://github.com/apache/ofbiz-framework/blob/trunk/build.gradle https://github.com/apache/jmeter/blob/master/gradle.properties https://github.com/apache/tomee/blob/main/pom.xml On Mon, 17 Jul 2023, 18:39 Gilles Sadowski, wrote: > Le lun. 17 juil. 2023 à 15:19, Dimitrios Efthymiou > a écrit : > > > > I don't have specific functionality in mind. > > You mentioned ASF projects which, IIUC, you said depend on > "Commons Math". So I asked: On which "Commons Math" > utilities do they depend? [Last time I checked (I don't remember > where or how), most were from the "stat" package).] > > > I just had an idea > > to do a search for dependencies on java.lang.Math or BigInteger > > or BigDecimal and if I find any, I would see if these dependencies > > exist because the project has its own custom math algorithms. > > If yes then, there you go. We have something to replace by > > utilising the commons math libraries. I haven't done a > > search yet. I wanted to see if the community would be OK > > with new tickets (if any) for new functionality to be implemented > > in the math libraries, GIVEN that there will automatically be > > use-cases i.e. apache already uses those algorithms. > > When I suggest new math functionality, I am always asked > > what the use-cases are and I don't have any, because I just > > want to implement unimplemented math algorithms. So, I thought > > that this way (if I find any) there will be use-cases > > Yes, but if those projects don't want to depend on the new > functionality, your time would be better used elsewhere. > As you could read today[1], it's difficult to even share code > inside the "Commons" project. For another project to > delegate some functionality is much more to ask. What > usually happens is the other way around; some functionality > already exists somewhere, and is taken advantage of right > away. > For better or (and?) worse, most use-cases came from > people who were using CM and needed something more, > which they contributed back. > Since it's "there" already, better improve it than find more > things to add (if you don't have use-cases for them). > Did I mention "clustering" and "genetic algorithm"? > > Regards, > Gilles > > [1] https://issues.apache.org/jira/browse/IMAGING-358 > > > > > On Mon, 17 Jul 2023 at 11:43, Gilles Sadowski > wrote: > > > > > Le lun. 17 juil. 2023 à 02:34, Dimitrios Efthymiou > > > a écrit : > > > > > > > > I didn't say to introduce a dependency on math. I said that libraries > > > that > > > > already depend on math, may have math algorithms implemented that we > > > could > > > > replace with a call to the appropriate commons math methods > > > > > > Sounds nice. > > > If we could already do that just within "Commons"... (see other post). > > > > > > > or if math > > > > doesn't have those math algorithms, we can move them to math. Flink > and > > > > HBase for example depend on math > > > > > > For which functionality? > > > > > > Regards, > > > Gilles > > > > > > >> [...] > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
Re: Move math algorithms from all projects to math libraries
OK. That is what I need to know. Thank you Gilles On Mon, 17 Jul 2023 at 23:22, Gilles Sadowski wrote: > Le lun. 17 juil. 2023 à 20:49, Dimitrios Efthymiou > a écrit : > > > > All i am saying is that if HBase has a class, say MathUtils and a method > > add(double... numbers) and its body has the math algorithm to do > addition, > > we can just replace the method body with a call to the appropriate math > > class that does addition. That's all i am saying. HBase, for example > > already depends on math. I am not saying, change the API of HBase. Just > > extract whatever math algorithms HBase has, put them in math (if they > don't > > exist there already) and call math. > > Only the concerned projects can tell if they would be willing > to transfer some code to "Commons". > > Gilles > > > [...] > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
Re: Move math algorithms from all projects to math libraries
good to know. I also see https://cwiki.apache.org/confluence/display/COMMONS/MathWishList Is this page still valid. I mean, could I work on one of these, like Add further functionality for BigDecimal <https://cwiki.apache.org/confluence/display/COMMONS/MathWishList#> and BigInteger <https://cwiki.apache.org/confluence/display/COMMONS/MathWishList#> arithmetic On Mon, 17 Jul 2023 at 23:22, Gilles Sadowski wrote: > Le lun. 17 juil. 2023 à 20:49, Dimitrios Efthymiou > a écrit : > > > > All i am saying is that if HBase has a class, say MathUtils and a method > > add(double... numbers) and its body has the math algorithm to do > addition, > > we can just replace the method body with a call to the appropriate math > > class that does addition. That's all i am saying. HBase, for example > > already depends on math. I am not saying, change the API of HBase. Just > > extract whatever math algorithms HBase has, put them in math (if they > don't > > exist there already) and call math. > > Only the concerned projects can tell if they would be willing > to transfer some code to "Commons". > > Gilles > > > [...] > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
Re: Move math algorithms from all projects to math libraries
Thanks Gilles. I checked NUMBERS-193 and i have an implementation of DD and i will put it in *.ext package (TBD) along with some tests. Do i have to look at Dfd.java or something, because these dfd classes in math legacy core have lots of hard-coded decimals in there. Do these need to be copied to DD or just implement the high/low part, add, multiply and checks for overflows? On Tue, 18 Jul 2023, 00:53 Gilles Sadowski, wrote: > Le mar. 18 juil. 2023 à 00:38, Dimitrios Efthymiou > a écrit : > > > > good to know. I also see > > https://cwiki.apache.org/confluence/display/COMMONS/MathWishList > > Is this page still valid. > > At the top: > ---CUT--- > Created by ASF Infrabot, last modified on Nov 01, 2013 > ---CUT--- > What do you think? > This is a mixed bag of disparate ideas, some of which were (partly or > completely) implemented, some weren't even discussed on the ML > since then. > > The authoritative list of things to do first are those for which there is > a decently recent discussion on JIRA. > > > I mean, could I work on one of these, like > > Add further functionality for BigDecimal > > <https://cwiki.apache.org/confluence/display/COMMONS/MathWishList#> and > > BigInteger > > <https://cwiki.apache.org/confluence/display/COMMONS/MathWishList#> > > arithmetic > > See e.g. https://issues.apache.org/jira/browse/NUMBERS-193 > > Regards, > Gilles > > > > > On Mon, 17 Jul 2023 at 23:22, Gilles Sadowski > wrote: > > > > > Le lun. 17 juil. 2023 à 20:49, Dimitrios Efthymiou > > > a écrit : > > > > > > > > All i am saying is that if HBase has a class, say MathUtils and a > method > > > > add(double... numbers) and its body has the math algorithm to do > > > addition, > > > > we can just replace the method body with a call to the appropriate > math > > > > class that does addition. That's all i am saying. HBase, for example > > > > already depends on math. I am not saying, change the API of HBase. > Just > > > > extract whatever math algorithms HBase has, put them in math (if they > > > don't > > > > exist there already) and call math. > > > > > > Only the concerned projects can tell if they would be willing > > > to transfer some code to "Commons". > > > > > > Gilles > > > > > > > [...] > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
Re: Move math algorithms from all projects to math libraries
Absolutely. Thanks On Tue, 18 Jul 2023, 07:39 Alex Herbert, wrote: > On Tue, 18 Jul 2023 at 01:48, Dimitrios Efthymiou > wrote: > > > > Thanks Gilles. I checked NUMBERS-193 and i have an implementation of DD > and > > i will put it in *.ext package (TBD) along with some tests. Do i have to > > look at Dfd.java or something, because these dfd classes in math legacy > > core have lots of hard-coded decimals in there. Do these need to be > copied > > to DD or just implement the high/low part, add, multiply and checks for > > overflows? > > I am currently working on the implementation for this by porting what > I created for Statistics. If you can wait for this to be completed > then we can discuss the functionality and public API on the mailing > list or Jira ticket. > > Alex > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
Re: Move math algorithms from all projects to math libraries
Hi Gilles. Question about the clustering package What should happen? Create a new module commons-math-clustering and then literally move the code from legacy to commons-math-clustering? Are there tickets or should I create one that explains that we are moving the legacy clustering package to a new module? Where is the document with the precise requirements and instructions? On Mon, 17 Jul 2023 at 18:39, Gilles Sadowski wrote: > Le lun. 17 juil. 2023 à 15:19, Dimitrios Efthymiou > a écrit : > > > > I don't have specific functionality in mind. > > You mentioned ASF projects which, IIUC, you said depend on > "Commons Math". So I asked: On which "Commons Math" > utilities do they depend? [Last time I checked (I don't remember > where or how), most were from the "stat" package).] > > > I just had an idea > > to do a search for dependencies on java.lang.Math or BigInteger > > or BigDecimal and if I find any, I would see if these dependencies > > exist because the project has its own custom math algorithms. > > If yes then, there you go. We have something to replace by > > utilising the commons math libraries. I haven't done a > > search yet. I wanted to see if the community would be OK > > with new tickets (if any) for new functionality to be implemented > > in the math libraries, GIVEN that there will automatically be > > use-cases i.e. apache already uses those algorithms. > > When I suggest new math functionality, I am always asked > > what the use-cases are and I don't have any, because I just > > want to implement unimplemented math algorithms. So, I thought > > that this way (if I find any) there will be use-cases > > Yes, but if those projects don't want to depend on the new > functionality, your time would be better used elsewhere. > As you could read today[1], it's difficult to even share code > inside the "Commons" project. For another project to > delegate some functionality is much more to ask. What > usually happens is the other way around; some functionality > already exists somewhere, and is taken advantage of right > away. > For better or (and?) worse, most use-cases came from > people who were using CM and needed something more, > which they contributed back. > Since it's "there" already, better improve it than find more > things to add (if you don't have use-cases for them). > Did I mention "clustering" and "genetic algorithm"? > > Regards, > Gilles > > [1] https://issues.apache.org/jira/browse/IMAGING-358 > > > > > On Mon, 17 Jul 2023 at 11:43, Gilles Sadowski > wrote: > > > > > Le lun. 17 juil. 2023 à 02:34, Dimitrios Efthymiou > > > a écrit : > > > > > > > > I didn't say to introduce a dependency on math. I said that libraries > > > that > > > > already depend on math, may have math algorithms implemented that we > > > could > > > > replace with a call to the appropriate commons math methods > > > > > > Sounds nice. > > > If we could already do that just within "Commons"... (see other post). > > > > > > > or if math > > > > doesn't have those math algorithms, we can move them to math. Flink > and > > > > HBase for example depend on math > > > > > > For which functionality? > > > > > > Regards, > > > Gilles > > > > > > >> [...] > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
[math] clustering package migration
Hello everyone. Question about the clustering package. I started moving the math4.ml.clustering package out of math legacy to a new module comons-math-clustering. There are some dependencies to legacy exceptions and the distance subpackage. Is there a roadmap for how to do this with instructions, TODOs and NOT-TODOs? For now I am moving 1 class at a time until I reach one that will depend on another module. Thank you
[math] legac ml.distance package migration
Hello everyone. I am working on the modularisation of the legacy ml.clustering package to a new module: commons-math-clustering. Some clustering classes depend on stat.moment.Variance and some of the ml.distance classes. 1--those distances belong to geometry probably and not machine learning. Manhattan distance, for example. 2--should I move the distance package to the new clustering module so that they are together or create a new commons-math-distance module? Or put the distance classes in the commons-math-geometry project?
[math] JIRA ticket for modularisation of all 14 legacy packages
Hello everyone. Is there, or gonna be, a dedicated ticket for the modularisation of all 14 packages commons-math-legacy has? I think that some of them are easy to modularise like optimisation, special and filter
Re: [math] JIRA ticket for modularisation of all 14 legacy packages
I saw 1575, but I didn't see subtasks for all 14 packages. Is there a plan to modularise all 14 packages? As for the dependencies on core, linear, analysis, well, from what I know, the way to modularise a codebase that was not designed to be modular, is to start moving classes that do not depend on legacy ones, 1-by-1, slowly. For classes that depend on legacy ones, then we can create new analysis and linear modules, create interfaces in them that have the methods our new modularised classes need, have the legacy classes in analysis and linear implement those interfaces, have the legacy module depend on the new analysis and linear modules (since they have the new interfaces), have the new optimisation module depend on the new analysis and linear modules and gradually you can move implementation code from the legacy to the new modules. The dependencies will be from legacy to the new modules and not the other way around. So the process I would try is: 1--create module commons-math-optimisation 2--create module commons-math-analysis 3--create module commons-math-linear-algebra 4--see on which analysis classes does optimisation depends? 5--see no which specific methods does optimisation depends? 6--create interfaces in commons-math-analysis for those classes and their methods that optimisation needs 7--have the analysis classes implement their respective interfaces from commons-math-analysis (maintaining the API) 8--have commons-math-legacy depend on commons-math-analysis and commons-math-linear-algebra 9--use these interfaces from within commons-math-optimisation 10-gradual move of methods and classes from commons-math-legacy to commons-math-optimisation, commons-math-analysis, commons-math-linear-algebra On Wed, 19 Jul 2023 at 09:49, Gilles Sadowski wrote: > Hello. > > Le mer. 19 juil. 2023 à 02:33, Dimitrios Efthymiou > a écrit : > > > > Hello everyone. Is there, or gonna be, a dedicated ticket for the > > modularisation of all 14 packages commons-math-legacy has? > > https://issues.apache.org/jira/browse/MATH-1575 > > > I think that > > some of them are easy to modularise like optimisation, > > When I list the dependencies towards other packages in "legacy", > I see > o.a.c.math4.legacy.core > o.a.c.math4.legacy.linear > o.a.c.math4.legacy.analysis > > How do you suggest to handle it? > > > special > > Here, there is only one class, but it should be analysed to > suggest a better API (and maybe improve performance). > There is also the question of whether to provide this and other > special functions with extended precision[1] (and maybe move > them to [Numbers]; like the gamma family of functions). > > > and filter > > When I list the dependencies towards other packages in "legacy", > I see > o.a.c.math4.legacy.linear > > Regards, > Gilles > > > [1] See section 7.4 in D. Bailey's documentation: > https://www.davidhbailey.com/dhbpapers/mpfun2020.pdf > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
Re: [math] JIRA ticket for modularisation of all 14 legacy packages
thanks Gilles. 1--I think I broke the build, because I did not include (correctly) the dependency on clustering inside the root pom.xml. My local build succeeds. I hope that the GitHub build succeeds, as well. 2--As for the atomic refactoring and feature branch, well, unless someone moves the Variance class (you said that someone is doing it now) and the distance package and whatever other dependencies exist within the ml.clustering package, there can be no moving of the remaining clustering classes to the new clustering module, right? 3--I see that the commons-statistics project, for example, has empty modules. I think the geometry project (I don't remember which one) has some classes that are still in commons-math, because the migration is not complete. So, I thought that I coud do the same i.e. move the clusteirng classes that do not depend on anything 4--I don't know how to continue with the clustering modularisation given all those dependencies. Maybe I shouldn't have started this, because now I am stuck On Wed, 19 Jul 2023 at 11:36, Gilles Sadowski wrote: > Hello. > > Le mer. 19 juil. 2023 à 11:21, Dimitrios Efthymiou > a écrit : > > > > I saw 1575, but I didn't see subtasks for all 14 packages. > > Is there a plan to modularise all 14 packages? > > Obviously, it would be good to achieve that, as pointed out > in the release notes of version 4.0-beta1: > https://commons.apache.org/proper/commons-math/changes-report.html > > But there is no "plan", like an ordered list of instructions to > follow from start to end. > The general task is "refactoring". > > > As for the dependencies on core, linear, analysis, well, > > from what I know, the way to modularise a codebase that > > was not designed to be modular, is to start moving classes > > that do not depend on legacy ones, 1-by-1, > > And break the build like it is currently the case with the > "clustering" refactoring? > > > slowly. > > As noted on JIRA[1], the move of an existing functionality into > its own (maven) module should be "atomic" on the "master" > branch. When the refactoring (started on a developer's local > machine) is sufficiently advanced, we can create a feature > branch so that several developers can more easily collaborate. > > > For classes that depend on legacy ones, then we can create > > new analysis and linear modules, create interfaces in them > > that have the methods our new modularised classes need, > > have the legacy classes in analysis and linear implement > > those interfaces, have the legacy module depend on the new > > analysis and linear modules (since they have the new interfaces), > > have the new optimisation module depend on the new > > analysis and linear modules and gradually you can move implementation > > code from the legacy to the new modules. The dependencies > > will be from legacy to the new modules and not the other way > > around. So the process I would try is: > > 1--create module commons-math-optimisation > > 2--create module commons-math-analysis > > 3--create module commons-math-linear-algebra > > 4--see on which analysis classes does optimisation depends? > > 5--see no which specific methods does optimisation depends? > > 6--create interfaces in commons-math-analysis for those classes and their > > methods that optimisation needs > > 7--have the analysis classes implement their respective interfaces from > > commons-math-analysis (maintaining the API) > > 8--have commons-math-legacy depend on commons-math-analysis and > > commons-math-linear-algebra > > 9--use these interfaces from within commons-math-optimisation > > 10-gradual move of methods and classes from commons-math-legacy to > > commons-math-optimisation, commons-math-analysis, > > commons-math-linear-algebra > > Sure! :-} > The devil is in the details... > > One crucial task is to have a way to (optionally) call external > implementations of linear algebra algorithms and data-structures. > I've no idea whether it's possible to adapt all the functionality to a > new design based only on interfaces (and not loose performance). > Unless we can really switch between alternative implementations > this is a lot of work with literally no gain. > Another possibility (also mentioned in [1]) is to isolate the needed > utilities in a "private" toolbox. [However, I'd be *very* reluctant if it > entails copying several hundred or thousand lines.] > > Regards, > Gilles > > [1] > https://issues.apache.org/jira/browse/MATH-1579?focusedCommentId=17744504&page=com.atlassian.jira.plugin.system.issuetabpa
Re: [math] JIRA ticket for modularisation of all 14 legacy packages
no. I mean creating maven modules inside commons-math, like the existing ones: commons-math-neuralnet commons-math-transform On Wed, 19 Jul 2023 at 12:29, Elliotte Rusty Harold wrote: > Could you be precise about what you mean by "modularisation"? It's a > very overloaded term. Do you mean Java 9 modules as defined by the > JPMS? > > On Wed, Jul 19, 2023 at 12:33 AM Dimitrios Efthymiou > wrote: > > > > Hello everyone. Is there, or gonna be, a dedicated ticket for the > > modularisation of all 14 packages commons-math-legacy has? I think that > > some of them are easy to modularise like optimisation, special and filter > > > > -- > Elliotte Rusty Harold > elh...@ibiblio.org > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
Re: [math] JIRA ticket for modularisation of all 14 legacy packages
I see. I didn't suggest I would start creating modules here and there. I just wanted to know if there is a plan to, eventually, put all those legacy packages into their own projects like analysis, linear algebra, special functions, optimisation, etc. That's all. I am not gonna do it. But since on of my favourite things in programming is playing with legacy code and refactoring, I wanted to know if there is a plan for these things. I guess eventually, yes. On Wed, 19 Jul 2023 at 12:43, Elliotte Rusty Harold wrote: > Ok, don't do that unless it's new code in new packages. Otherwise > you're creating a dependency hell for existing clients. It is > extremely developer hostile. Pretty much all of https://jlbp.dev/ > applies but especially > > JLBP-5: Do not include a class in more than one classpath entry > JLBP-6: Rename artifacts and packages together > > Debugging the problems this will cause is difficult and painful, even > for someone well-versed in Maven dependency management. > > On Wed, Jul 19, 2023 at 11:37 AM Dimitrios Efthymiou > wrote: > > > > no. I mean creating maven modules inside commons-math, like > > the existing ones: > > commons-math-neuralnet > > commons-math-transform > > > > On Wed, 19 Jul 2023 at 12:29, Elliotte Rusty Harold > > wrote: > > > > > Could you be precise about what you mean by "modularisation"? It's a > > > very overloaded term. Do you mean Java 9 modules as defined by the > > > JPMS? > > > > > > On Wed, Jul 19, 2023 at 12:33 AM Dimitrios Efthymiou > > > wrote: > > > > > > > > Hello everyone. Is there, or gonna be, a dedicated ticket for the > > > > modularisation of all 14 packages commons-math-legacy has? I think > that > > > > some of them are easy to modularise like optimisation, special and > filter > > > > > > > > > > > > -- > > > Elliotte Rusty Harold > > > elh...@ibiblio.org > > > > > > - > > > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > > > For additional commands, e-mail: dev-h...@commons.apache.org > > > > > > > > > > -- > Elliotte Rusty Harold > elh...@ibiblio.org > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
Re: [math] JIRA ticket for modularisation of all 14 legacy packages
are you saying that in order to move the ml.clustering classes to the new clustering module, I can take all the dependencies to classes and their transitive dependencies, copy them to the new clustering module, but only keep in them the minimum required code for the new module to operate? On Thu, 20 Jul 2023 at 15:27, Gilles Sadowski wrote: > Hello. > > Le mer. 19 juil. 2023 à 12:59, Dimitrios Efthymiou > a écrit : > > > > [...] > > 1-- [...] > > 2--As for the atomic refactoring and feature branch, well, > > unless someone moves the Variance class (you said that someone > > is doing it now) and the distance package and whatever other > > dependencies exist within the ml.clustering package, > > there can be no moving of the remaining clustering classes > > to the new clustering module, right? > > 3-- [...] > > 4--I don't know how to continue with the clustering modularisation > > given all those dependencies. Maybe I shouldn't have started this, > > because now I am stuck > > You aren't. > > The dependencies found in "o.a.c.math4.legacy.ml.clustering" are > (1) "MatrixUtils" and "RealMatrix" (from the "linear" package) > (2) "Variance" and "VectorialMean" (from the "stat" package) > > (1) creates the coupling for a single method ("getMembershipMatrix") > that isn't called from anywhere (not even the unit tests). Remove the > method and the dependency towards "linear" vanishes. > > (2) "Variance" can be replaced with a temporary implementation like > (untested copy/paste from "SecondMoment" and "FirstMoment"): > ---CUT--- > class Variance { > private int n = 0; > private double dev = 0; > private double nDev = 0; > private double m2 = 0; > private double m1 = 0; > > void increment(final double d) { > ++n; > dev = d - m1; > nDev = dev / n; > m1 += nDev; > m2 += ((double) n - 1) * dev * nDev; > } > > double get() { > return m2; > } > } > ---CUT--- > Then, creating a private copy of class "VectorialMean" (replacing, > in the copy, CM exceptions with JDK ones) would complete the > removal of the dependency towards the "stat" package. > > And so on. > > Regards, > Gilles > > > > > [...] > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
Re: [math] JIRA ticket for modularisation of all 14 legacy packages
Unfortunately, i just tried a simple move, but there are deoendencies on 3 distance classes and about 12 stats classes, because there are transitive dependencies. Not to mention the respective test classes. On Thu, 20 Jul 2023, 22:22 Gilles Sadowski, wrote: > Le jeu. 20 juil. 2023 à 21:19, Dimitrios Efthymiou > a écrit : > > > > are you saying that in order to move the ml.clustering classes > > to the new clustering module, I can take all the dependencies to classes > > and their transitive dependencies, copy them to the new clustering > module, > > but only keep in them the minimum required code for the new module to > > operate? > > To some extent, yes. But the main point is the refactoring. For example, > your wouldn't copy the code from "linear" after seeing that one can do > without it. But also note in this case that exposing a "double[][]" > instead > may not be the best choice for a long-term API. As was mentioned, it > would be worth looking at how other libraries provide similar > functionality. > The module should solve all issues mentioned in JIRA; it's not just copying > the classes and removing dependencies. > > Gilles > > > > > On Thu, 20 Jul 2023 at 15:27, Gilles Sadowski > wrote: > > > > > Hello. > > > > > > Le mer. 19 juil. 2023 à 12:59, Dimitrios Efthymiou > > > a écrit : > > > > > > > > [...] > > > > 1-- [...] > > > > 2--As for the atomic refactoring and feature branch, well, > > > > unless someone moves the Variance class (you said that someone > > > > is doing it now) and the distance package and whatever other > > > > dependencies exist within the ml.clustering package, > > > > there can be no moving of the remaining clustering classes > > > > to the new clustering module, right? > > > > 3-- [...] > > > > 4--I don't know how to continue with the clustering modularisation > > > > given all those dependencies. Maybe I shouldn't have started this, > > > > because now I am stuck > > > > > > You aren't. > > > > > > The dependencies found in "o.a.c.math4.legacy.ml.clustering" are > > > (1) "MatrixUtils" and "RealMatrix" (from the "linear" package) > > > (2) "Variance" and "VectorialMean" (from the "stat" package) > > > > > > (1) creates the coupling for a single method ("getMembershipMatrix") > > > that isn't called from anywhere (not even the unit tests). Remove the > > > method and the dependency towards "linear" vanishes. > > > > > > (2) "Variance" can be replaced with a temporary implementation like > > > (untested copy/paste from "SecondMoment" and "FirstMoment"): > > > ---CUT--- > > > class Variance { > > > private int n = 0; > > > private double dev = 0; > > > private double nDev = 0; > > > private double m2 = 0; > > > private double m1 = 0; > > > > > > void increment(final double d) { > > > ++n; > > > dev = d - m1; > > > nDev = dev / n; > > > m1 += nDev; > > > m2 += ((double) n - 1) * dev * nDev; > > > } > > > > > > double get() { > > > return m2; > > > } > > > } > > > ---CUT--- > > > Then, creating a private copy of class "VectorialMean" (replacing, > > > in the copy, CM exceptions with JDK ones) would complete the > > > removal of the dependency towards the "stat" package. > > > > > > And so on. > > > > > > Regards, > > > Gilles > > > > > > > > > [...] > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
Re: [math] JIRA ticket for modularisation of all 14 legacy packages
I am not home now, but these are the ones i remember from looking at the GitHub repo: AbstractStorelessUnivariateStatistic.java AbstractUnivariateStatistic.java WeightedEvaluation.java Sum.java FirstMoment.java Mean.java SecondMoment.java StandardDeviation.java Variance.java VectorialMean.java On Thu, 20 Jul 2023, 22:40 Gilles Sadowski, wrote: > Le jeu. 20 juil. 2023 à 23:28, Dimitrios Efthymiou > a écrit : > > > > Unfortunately, i just tried a simple move, but there are deoendencies on > 3 > > distance classes > > But... those classes are only used by the "clustering" package; they > are not external dependencies; they would go into the new module > as first-class citizens. > [A follow-up issue would be whether those distance classes are > worth sharing with the other machine learning utility in the module > "commons-math-neuralnet".] > > > and about 12 stats classes, > > Which ones? > > > because there are transitive > > dependencies. Not to mention the respective test classes. > > Well, of course there is work to do to fix all aspects of the move... > > Gilles > > > > > > > > > [...] > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
Re: [math] JIRA ticket for modularisation of all 14 legacy packages
I am not home now, but these are the ones i remember from looking at the GitHub repo: AbstractStorelessUnivariateStatistic.java AbstractUnivariateStatistic.java WeightedEvaluation.java Sum.java FirstMoment.java Mean.java SecondMoment.java StandardDeviation.java Variance.java VectorialMean.java On Thu, 20 Jul 2023, 22:40 Gilles Sadowski, wrote: > Le jeu. 20 juil. 2023 à 23:28, Dimitrios Efthymiou > a écrit : > > > > Unfortunately, i just tried a simple move, but there are deoendencies on > 3 > > distance classes > > But... those classes are only used by the "clustering" package; they > are not external dependencies; they would go into the new module > as first-class citizens. > [A follow-up issue would be whether those distance classes are > worth sharing with the other machine learning utility in the module > "commons-math-neuralnet".] > > > and about 12 stats classes, > > Which ones? > > > because there are transitive > > dependencies. Not to mention the respective test classes. > > Well, of course there is work to do to fix all aspects of the move... > > Gilles > > > > > > > > > [...] > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >