Improve spell checker using codespell

* Configures automated spell checking with codespell
Adds GitHub workflows and configuration files for automated spell checking using `codespell`.

This includes:
- A workflow for checking pull requests and preventing new typos
- A workflow for automatically fixing typos in the main codebase
- Configuration files for `codespell` to ignore specific terms and file types
- Documentation on how to use and configure the spell checking workflows.

* Corrects minor spelling and grammar errors.
This commit is contained in:
Magne Sjaastad authored and GitHub committed 2025-11-19 10:25:32 +01:00
1 parent 073e80d0a0
commit 544e9eedd9
96 files changed
+455 -147

No files matched your search

@@ -358,8 +358,6 @@ void RigTransmissibilityCondenser::calculateCondensedTransmissibilities()
++c1EquationIdx;
}
// std::cout << "T = " << std::endl << totalSystem << std::endl;
int externalEquationCount = totalEquationCount - internalEquationCount;
MatrixXd condensedSystem;
@@ -374,30 +372,18 @@ void RigTransmissibilityCondenser::calculateCondensedTransmissibilities()
MatrixXd Tei = totalSystem.bottomLeftCorner( externalEquationCount, internalEquationCount );
MatrixXd Tii = totalSystem.topLeftCorner( internalEquationCount, internalEquationCount );
// std::ofstream outFileStream( "D:\\Data\\TestData\\TiiMatrix.txt" );
// outFileStream << Tii;
Eigen::FullPivLU<MatrixXd> solver( Tii );
// outFileStream << std::endl;
// outFileStream << "Rows x Cols: " << Tii.rows() << "x" << Tii.cols() << std::endl;
// outFileStream << "Invertible: " << ( solver.isInvertible() ? "True" : "False" ) << std::endl;
// outFileStream << "Condition: " << solver.rcond() << std::endl;
// outFileStream << "Rank: " << solver.rank() << std::endl;
m_TiiInv = solver.inverse();
m_Tie = totalSystem.topRightCorner( internalEquationCount, externalEquationCount );
condensedSystem = Tee - Tei * m_TiiInv * m_Tie;
}
// std::cout << "Te = " << std::endl << condensedSystem << std::endl << std::endl;
for ( int exEqIdx = 0; exEqIdx < externalEquationCount; ++exEqIdx )
{
for ( int exColIdx = exEqIdx + 1; exColIdx < externalEquationCount; ++exColIdx )
{
double T = condensedSystem( exEqIdx, exColIdx );
// if (T != 0.0)
{
CellAddress cell1 = eqIdxToCellAddressMapping[exEqIdx + internalEquationCount];
CellAddress cell2 = eqIdxToCellAddressMapping[exColIdx + internalEquationCount];
@@ -427,7 +427,7 @@ void RigMswDataFormatter::formatMswTables( RifTextDataTableFormatter& formatter,
for ( const auto& wellData : unifiedData.wellDataList() )
{
bool isLgrData = false;
formatCompsegsTable( formatter, wellData, isLgrData ); // Main grid, LGR is handeled separately
formatCompsegsTable( formatter, wellData, isLgrData ); // Main grid, LGR is handled separately
}
formatWsegvalvTable( formatter, unifiedData );
@@ -3096,7 +3096,7 @@ void RigCaseCellResultsData::copyResultsMetaDataFromMainCase( RigEclipseCaseData
RimEclipseResultCase* rimReservoir = dynamic_cast<RimEclipseResultCase*>( destinationCases[i] );
if ( !rimReservoir ) continue; // Input reservoir
if ( mainCaseResultsData == rimReservoir->eclipseCaseData() ) continue; // Do not copy ontop of itself
if ( mainCaseResultsData == rimReservoir->eclipseCaseData() ) continue; // Do not copy on top of itself
RigCaseCellResultsData* cellResultsStorage = rimReservoir->results( poroModel );
@@ -181,7 +181,7 @@ bool RigCell::isLongPyramidCell( double maxHeightFactor, double nodeNearToleranc
const cvf::Vec3d& c2opp = nodes[m_cornerIndices[faceVertexIndices[2]]];
const cvf::Vec3d& c3opp = nodes[m_cornerIndices[faceVertexIndices[3]]];
// Check if any of the opposite face vertexes are also degenerated to the pyramid top
// Check if any of the opposite face vertices are also degenerated to the pyramid top
int okVertexCount = 0;
cvf::Vec3d okVxs[4];
@@ -713,7 +713,7 @@ std::vector<cvf::Vec3d> RigCellGeometryTools::ajustPolygonToAvoidIntersectionsAt
{
std::vector<cvf::Vec3d> adjustedPolygon;
double treshold = ( 1.0 / 10000.0 ) * 5; // 5 times polygonScaleFactor for converting to int for clipper
double threshold = ( 1.0 / 10000.0 ) * 5; // 5 times polygonScaleFactor for converting to int for clipper
for ( cvf::Vec3d polygonPoint : polygon )
{
@@ -723,7 +723,7 @@ std::vector<cvf::Vec3d> RigCellGeometryTools::ajustPolygonToAvoidIntersectionsAt
cvf::Vec3d linePoint2( polyLine[i + 1].x(), polyLine[i + 1].y(), 0.0 );
double pointDistanceFromLine = cvf::GeometryTools::linePointSquareDist( linePoint1, linePoint2, polygonPoint );
if ( pointDistanceFromLine < treshold )
if ( pointDistanceFromLine < threshold )
{
// calculate new polygonPoint
cvf::Vec3d directionOfLineSegment = linePoint2 - linePoint1;
@@ -175,7 +175,7 @@ void RigGridBase::initSubCellsMainGridCellIndex()
//--------------------------------------------------------------------------------------------------
/// For main grid, this will work with reservoirCellIndices retrieving the correct lgr cells as well.
/// the cell() call retreives correct cell, because main grid has offset of 0, and we access the global
/// the cell() call retrieves correct cell, because main grid has offset of 0, and we access the global
/// cell array in main grid.
//--------------------------------------------------------------------------------------------------
std::array<cvf::Vec3d, 8> RigGridBase::cellCornerVertices( size_t cellIndex ) const
@@ -402,7 +402,7 @@ cvf::Vec3d RigGridBase::displayModelOffset() const
}
//--------------------------------------------------------------------------------------------------
/// Returns the min size of the I and J charactristic cell sizes
/// Returns the min size of the I and J characteristic cell sizes
//--------------------------------------------------------------------------------------------------
double RigGridBase::characteristicIJCellSize() const
{
@@ -179,7 +179,7 @@ size_t RigMainGrid::findReservoirCellIndexFromPoint( const cvf::Vec3d& point ) c
void RigMainGrid::addLocalGrid( RigLocalGrid* localGrid )
{
CVF_ASSERT( localGrid && localGrid->gridId() != cvf::UNDEFINED_INT ); // The grid ID must be set.
CVF_ASSERT( localGrid->gridId() >= 0 ); // We cant handle negative ID's if they exist.
CVF_ASSERT( localGrid->gridId() >= 0 ); // We can't handle negative ID's if they exist.
m_localGrids.push_back( localGrid );
localGrid->setGridIndex( m_localGrids.size() ); // Maingrid itself has grid index 0
@@ -300,7 +300,7 @@ const RigGridBase* RigMainGrid::gridByIndex( size_t localGridIndex ) const
}
//--------------------------------------------------------------------------------------------------
/// Returns the grid with the given name. Main Grid itself could be retreived by using name ""
/// Returns the grid with the given name. Main Grid itself could be retrieved by using name ""
//--------------------------------------------------------------------------------------------------
RigGridBase* RigMainGrid::gridByName( const std::string& name )
{
@@ -1135,7 +1135,7 @@ std::array<double, 6> RigMainGrid::defaultMapAxes()
const double xPoint[2] = { 1.0, 0.0 };
const double yPoint[2] = { 0.0, 1.0 };
// Order (see Elipse Reference Manual for keyword MAPAXES): Y_x, Y_y, O_x, O_y, X_x, X_y
// Order (see Reference Manual for keyword MAPAXES): Y_x, Y_y, O_x, O_y, X_x, X_y
return { yPoint[0], yPoint[1], origin[0], origin[1], xPoint[0], xPoint[1] };
}
@@ -215,8 +215,7 @@ void RigNumberOfFloodedPoreVolumesCalculator::calculate( RigMainGrid*
for ( size_t timeStep = 1; timeStep < daysSinceSimulationStart.size(); timeStep++ )
{
std::vector<double> totoalFlowrateIntoCell( resultCellCount ); // brukt result celle index / active antall i
// stedet
std::vector<double> totoalFlowrateIntoCell( resultCellCount );
if ( flowrateIatAllTimeSteps[timeStep - 1] != nullptr && flowrateJatAllTimeSteps[timeStep - 1] != nullptr &&
flowrateKatAllTimeSteps[timeStep - 1] != nullptr )
@@ -56,7 +56,7 @@ cvf::Vec3d RigStimPlanModelTools::calculateTSTDirection( RigEclipseCaseData* ecl
cvf::BoundingBox boundingBox( anchorPosition - boundingBoxSize, anchorPosition + boundingBoxSize );
std::vector<size_t> closeCells = mainGrid->findIntersectingCells( boundingBox );
// The stratigraphic thickness is the averge of normals of the top face
// The stratigraphic thickness is the average of normals of the top face
cvf::Vec3d direction = cvf::Vec3d::ZERO;
int numContributingCells = 0;
@@ -995,7 +995,7 @@ std::expected<void, QString> RigSimulationInputTool::addOperNumRegionAndOperater
// Replace keyword values in deck with extracted data
if ( deckFile.replaceKeywordData( "OPERNUM", result.value() ) )
{
RiaLogging::info( "Added replaced opernum value in exising position." );
RiaLogging::info( "Added replaced opernum value in existing position." );
}
else
{
@@ -195,12 +195,12 @@ double RigSimulationWellCoordsAndMD::simWellDipAngle( const cvf::Vec3d& position
cvf::Vec3d direction = p1 - p2;
double horizonal = sqrt( pow( direction.x(), 2 ) + pow( direction.y(), 2 ) );
double vertical = direction.z();
double horizontal = sqrt( pow( direction.x(), 2 ) + pow( direction.y(), 2 ) );
double vertical = direction.z();
if ( fabs( vertical ) > 1e-5 )
{
double atanValue = vertical / horizonal;
double atanValue = vertical / horizontal;
dipAngle = atan( atanValue );
dipAngle = cvf::Math::toDegrees( dipAngle );
}
@@ -201,7 +201,7 @@ double GeometryTools::signedAreaPlanarPolygon( const cvf::Vec3d& planeNormal, co
//--------------------------------------------------------------------------------------------------
/// This method below is more correct than the one above, both in naming and behaviour.
/// Should be replaced, but is not done now to avoid possible sideeffects
/// The difference is the sign of the area. The one below retuns correct sign according to the plane normal
/// The difference is the sign of the area. The one below returns correct sign according to the plane normal
/// provided
//--------------------------------------------------------------------------------------------------
template <typename Vec3Type>
@@ -225,7 +225,7 @@ double closestAxisSignedAreaPlanarPolygon( const cvf::Vec3d& planeNormal, const
/*
Determine the intersection point of two line segments
From Paul Bourke, but modified to really handle coincident lines
and lines with touching vertexes.
and lines with touching vertices.
Returns an intersection status telling what kind of intersection it is (if any)
*/
@@ -911,7 +911,7 @@ EarClipTesselator::EarClipTesselator()
//--------------------------------------------------------------------------------------------------
/// \brief Do the main processing/actual triangulation
/// \param triangleIndices Array that will receive the indices of the triangles resulting from the triangulation
/// \return true when a tesselation was successully created
/// \return true when a tessellation was successfully created
//--------------------------------------------------------------------------------------------------
bool EarClipTesselator::calculateTriangles( std::vector<size_t>* triangleIndices )
@@ -353,7 +353,7 @@ bool GeometryTools::calculateOverlapPolygonOfTwoQuads( std::vector<IndexType>&
// Loop over edges in the face of Cv1. Intersect each one with all the edges of the Cv2 face.
// Add first point of the cv1 edge to polygon if it really touches Cv2 ( touch of edge is considered as not
// touching) Add each intersection point along the Cv1 edge if present and finally: if the cv1 edge is going out of
// cv2, the add the cv2 vertexes from that intersection as long as they touch cv1.
// cv2, the add the cv2 vertices from that intersection as long as they touch cv1.
int nextCv1Idx = 1;
for ( cv1Idx = 0; cv1Idx < 4; ++cv1Idx, ++nextCv1Idx )
@@ -623,7 +623,7 @@ bool GeometryTools::calculateOverlapPolygonOfTwoQuads( std::vector<IndexType>&
}
//--------------------------------------------------------------------------------------------------
/// This method assumes that all intersection and mid edge vertexes are created an are already
/// This method assumes that all intersection and mid edge vertices are created an are already
/// merged into all the polygons. We can also assume that all the connection polygons are completely
/// inside (or sharing edges with) the cube face polygon initially
//--------------------------------------------------------------------------------------------------