Skip to content

989 khiops raw gui not active despite driver being installed#1008

Merged
bruno-at-orange merged 5 commits intomainfrom
989-khiops_raw_gui-not-active-despite-driver-being-installed
May 4, 2026
Merged

989 khiops raw gui not active despite driver being installed#1008
bruno-at-orange merged 5 commits intomainfrom
989-khiops_raw_gui-not-active-despite-driver-being-installed

Conversation

@bruno-at-orange
Copy link
Copy Markdown
Member

@bruno-at-orange bruno-at-orange commented Apr 27, 2026

  • fix KHIOPS_RAW_GUI not active despite driver being installed #989
  • Silence warnings with clang/macOS compiler
    • implicit conversion from 'long' to 'double'
    • Set but not used [-Wunused-but-set-parameter]
    • first argument in call to 'memset' is a pointer to non-trivially copyable type 'Symbol'
  • Pending warnings in files:
    - KWDerivationRule.cpp: Affectations with NULL commented with "Pour eviter le warning" produce a warning.
    - MHFloatingPointFrequencyTableBuilder::InitializeBins: variable 'cMantissa' set but not used. Weird...
    - KWGrouperMODLOptimization.cpp: in method EMPostOptimizeGroupsWithGarbage, variable nStart is not used but initialized with RandomInt. It could change the references in LearningTest
    - KWDataPreparation/* to avoid difficult conflicts
    - KWTest/*
  • modification of the view generation in order to silence warnings

Important

LearningTest full passed

@bruno-at-orange bruno-at-orange linked an issue Apr 27, 2026 that may be closed by this pull request
@bruno-at-orange bruno-at-orange force-pushed the 989-khiops_raw_gui-not-active-despite-driver-being-installed branch 3 times, most recently from c7ba60b to 06ea2a7 Compare April 27, 2026 09:00
@bruno-at-orange bruno-at-orange marked this pull request as ready for review April 27, 2026 09:21
The method GetLearningRawGuiModeMode() call GetLearningDefaultRawGuiModeMode()
Then, it must be called after SetLearningDefaultRawGuiModeMode()
@bruno-at-orange bruno-at-orange force-pushed the 989-khiops_raw_gui-not-active-despite-driver-being-installed branch 2 times, most recently from 60f8f8a to 1143018 Compare April 28, 2026 07:50
Copy link
Copy Markdown
Collaborator

@marcboulle marcboulle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modifier le générateur de code pour ne pas générer les variables locales inutilisées provoquant un warning.

Méthodes impactées:

  • TableGenerator::GenerateAttributeViewC
  • TableGenerator::GenerateAttributeArrayViewC

Code impacté:

ost << "void " << GetArrayViewClassName() << "::EventUpdate(Object* object)"
    << "\n";
ost << "{"
    << "\n";
ost << "\t" << GetModelClassName() << "* editedObject;"
    << "\n";
ost << ""
    << "\n";
ost << "\trequire(object != NULL);"
    << "\n";
ost << ""
    << "\n";
if (GetSuperClassName() != "")
	ost << "\t" << GetArrayViewSuperClassName() << "::EventUpdate(object);\n";
ost << "\teditedObject = cast(" << GetModelClassName() << "*, object);"
    << "\n";
for (nCurrent = 0; nCurrent < GetFieldNumber(); nCurrent++)
{
	att = GetFieldAt(nCurrent);

	if (att->GetVisible() and not att->GetDerived())
	{
		ost << "\teditedObject->Set" << att->GetName() << "("
		    << "Get" << att->GetFieldType() << "ValueAt(\"" << att->GetName() << "\")"
		    << ");"
		    << "\n";
	}
}

ost << ""
    << "\n";
GenerateUserCodeSection(ost, "\t", "Custom update");
ost << "}"

Conditionner la génération de la variable locale (ost << "\t" << GetModelClassName() << "* editedObject;"), et son accès ( ost << "\teditedObject = cast(" << GetModelClassName() << "*, object);" par un nombre de champs non null (if (GetFieldNumber() > 0)).

DTAttributeSelection* attributegenerator;
boolean bRegressionWithEqualFreqDiscretization = false;
boolean bRegressionWithMODLDiscretization = false;
int nBuidTreeNumber;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Utilisé dans le bloc de trace GENERATE_PYTHON_REPORTING_TRACES (ligne 1157).
On ne peut pas supprimer cette variable

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

j'ai tout mis dans le ifdef GENERATE_PYTHON_REPORTING_TRACES

// bOk = false;
// break;
//}
previousSlice = slice;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plutot que d'enlever cette variable, il faudrait changer le code mort

			// if (previousSlice != NULL and previousSlice->CompareLexicographicOrder(slice) >= 0)
			//{
			//	AddError("Wrong ordering between " + slice->GetClassLabel() + "s " +
			//		 previousSlice->GetObjectLabel() + " and " + slice->GetObjectLabel());
			//	bOk = false;
			//	break;
			//}

en

         assert(previousSlice == NULL or previousSlice->CompareLexicographicOrder(slice) < 0)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

// Memorisation des nombre de modalites, groupes et classes cibles
nModalityNumber = kwftSource->GetFrequencyVectorNumber();
nGroupNumber = kwftTarget->GetFrequencyVectorNumber();
nTargetNumber = kwftSource->GetFrequencyVectorSize();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

il n'y a plus et classes dans le commentaire

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -1572,7 +1569,7 @@ void DTGrouperMODL::FastPostOptimizeGroupsWithGarbage(KWFrequencyTable* kwftSour
// Memorisation des nombre de modalites, groupes et classes cibles
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

il n'y a plus et classes dans le commentaire

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -2080,7 +2076,6 @@ void DTGrouperMODL::PostOptimizeGroupsWithGarbageSearch(ObjectArray* oaInitialGr
// Memorisation des nombre de modalites, groupes et classes cibles
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

il n'y a plus et classes dans le commentaire

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


// Acces a la base source
sourceDatabase = shared_sourceDatabase.GetPLDatabase();
timer.Start();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

déplacer cette instruction e,tre le commentaire et la première instruction suivante bOk = bOk and...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

SystemFileDriverCreator::RegisterExternalDrivers();

// Parametrage du mode d'interface graphique en fonction des drivers de fichiers enregistres
SetLearningDefaultRawGuiModeMode(SystemFileDriverCreator::GetExternalDriverNumber());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

être plus explicite en passant un booléen en paramètre
SetLearningDefaultRawGuiModeMode(SystemFileDriverCreator::GetExternalDriverNumber() > 0);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

lSelectionScorerMemory = ComputeSlaveScorerNecessaryMemory();

// La memoire de l'esclave est celle des
lSlaveMemory = lLayoutMemory + lTargetValuesMemory + lBinarySliceSetSelfMemory;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai plutôt l'impression qu'il s'agit d'un oubli.
On devrait avoir

lSlaveMemory = lLayoutMemory + lTargetValuesMemory + lBinarySliceSetSelfMemory + lSelectionScorerMemory ;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread src/Norm/base/CharVector.cpp Outdated
int nErrorNumber;
int i;
boolean bOk;
boolean bVerbose = false;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changer en const boolean bTrace = false;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

require(IsEmpty());

bMissingMemory = GetMissingMemory() > 0;
bMissingDisk = GetMissingDisk() > 0;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il ne devrait pas y avoir un message en cas de manque de mémoire disque?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c'est déjà le cas...

Copy link
Copy Markdown
Collaborator

@marcboulle marcboulle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

- warnings 'Set but not used [-Wunused-but-set-parameter]'
- warnings for variable uninitialized
- warnings: implicit conversion from 'long' to 'double'
- warnings: first argument in call to 'memset' is a pointer to non-trivially copyable type 'Symbol'
- warning: ignoring duplicate libraries
- warning: Unused parameter

Silence warning with (void)variable

[IA Generated]

In C/C++, writing (void)variable means:

Convert the expression to type void
Discard its value
Tell the compiler: this is intentionally unused
So for an unused parameter, this pattern avoids warnings like “unused parameter”.

Why it helps in your case:

variable = NULL writes to the parameter, so compiler can warn “set but not used”
(void)variable does not write anything, it only marks the parameter as intentionally consumed
Typical use:

(void)kwoObject;
(void)indexedKeyBlock;

It has no runtime effect in practice, it is only for clarity and warning suppression.
When there isn't any attribute, it is not necessary to declare and cast the object.
It produces a warning "Set but not used"
@bruno-at-orange bruno-at-orange force-pushed the 989-khiops_raw_gui-not-active-despite-driver-being-installed branch from e10b111 to a0775f5 Compare May 4, 2026 09:40
@bruno-at-orange bruno-at-orange merged commit afa9342 into main May 4, 2026
29 checks passed
@bruno-at-orange bruno-at-orange deleted the 989-khiops_raw_gui-not-active-despite-driver-being-installed branch May 4, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KHIOPS_RAW_GUI not active despite driver being installed

2 participants