Skip to content

Commit 0b96f6b

Browse files
committed
♻️ fixed cmfeedback with new name
1 parent 42aeb08 commit 0b96f6b

File tree

12 files changed

+98
-98
lines changed

12 files changed

+98
-98
lines changed

src/__tests__/actions/ServerActions.test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
getDecodingDf,
1616
getEncodedUniqueValues,
1717
getRetrainValues,
18-
getCfFeedbackValues,
18+
getCmFeedbackValues,
1919
getModels,
2020
postPrediction,
2121
postReplay,
@@ -29,11 +29,11 @@ import {splitFailed, splitsFailed, splitsRetrieved, splitSucceeded} from '../../
2929
import {limeValueListFailed, limeValueListRetrieved, shapValueListRetrieved,
3030
shapValueListFailed, iceValueListRetrieved, iceValueListFailed,
3131
skaterValueListRetrieved, skaterValueListFailed, retrainValueListRetrieved,
32-
retrainValueListFailed, cffeedbackValueListRetrieved,
33-
cffeedbackValueListFailed} from '../../actions/ExplanationActions';
32+
retrainValueListFailed, cmfeedbackValueListRetrieved,
33+
cmfeedbackValueListFailed} from '../../actions/ExplanationActions';
3434
import {limeTemporalStabilityResult, encodedUniqueDFResultList, temporalStabilityResult,
3535
limeList, shapResult, iceResultList, skaterResult,
36-
retrainResult, cfFeedbackResult, decodedDFResultList, traceList} from '../../../stories/Explanation';
36+
retrainResult, cmFeedbackResult, decodedDFResultList, traceList} from '../../../stories/Explanation';
3737
import {temporalLimePredictionListRetrieved, temporalPredictionListRetrieved,
3838
temporalPredictionListFailed, temporalLimePredictionListFailed} from '../../actions/PredictionAction';
3939
import {modelsRetrieved, modelsFailed} from '../../actions/ModelActions';
@@ -511,24 +511,24 @@ describe('ServerActions', function () {
511511
});
512512
});
513513

514-
describe('getCfFeedbackValues', () => {
515-
it('dispatches CfFeedbackValues on success', () => {
516-
mockXHR.responseText = JSON.stringify(cfFeedbackResult);
514+
describe('getCmFeedbackValues', () => {
515+
it('dispatches CmFeedbackValues on success', () => {
516+
mockXHR.responseText = JSON.stringify(cmFeedbackResult);
517517

518-
getCfFeedbackValues({jobId: 1, attribute: 'Age'})(dispatch);
518+
getCmFeedbackValues({jobId: 1, attribute: 'Age'})(dispatch);
519519
mockXHR.onreadystatechange();
520520

521521
expect(dispatch.mock.calls[0][0])
522-
.toEqual(cffeedbackValueListRetrieved(cfFeedbackResult));
522+
.toEqual(cmfeedbackValueListRetrieved(cmFeedbackResult));
523523
});
524-
it('dispatches CfFeedbackValues on error', () => {
524+
it('dispatches CmFeedbackValues on error', () => {
525525
standardError(mockXHR);
526526

527-
getCfFeedbackValues({jobId: 1, traceId: 1})(dispatch);
527+
getCmFeedbackValues({jobId: 1, traceId: 1})(dispatch);
528528
mockXHR.onreadystatechange();
529529

530530
expect(dispatch.mock.calls[0][0])
531-
.toEqual(cffeedbackValueListFailed(error.error));
531+
.toEqual(cmfeedbackValueListFailed(error.error));
532532
});
533533
});
534534
});

src/__tests__/components/explanation/CfFeedback.test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react';
22
import {shallow} from 'enzyme';
33
import CircularProgress from 'react-md/lib/Progress/CircularProgress';
4-
import {retrainResult, cfFeedbackResult, uniqueEncodedDecodedValues} from '../../../../stories/Explanation';
5-
import CfFeedback from '../../../components/explanation/CfFeedback';
4+
import {retrainResult, cmFeedbackResult, uniqueEncodedDecodedValues} from '../../../../stories/Explanation';
5+
import CmFeedback from '../../../components/explanation/CmFeedback';
66
import RetrainResultTable from '../../../components/explanation/RetrainResultTable';
77
import {TextField, SelectField} from 'react-md';
88
import CfFeedbackResulttTable from '../../../components/explanation/CfFeedbackResulttTable';
@@ -11,17 +11,17 @@ import {getUniqueFeatureValues, getFeatureNames, encodePatternsForDropdown} from
1111
const onSubmitTopK = jest.fn();
1212
const onSubmitFeatureNamesAndValues = jest.fn();
1313

14-
describe('CfFeedback result', () => {
14+
describe('CmFeedback result', () => {
1515
it('All data loaded', () => {
16-
const element = shallow(<CfFeedback
16+
const element = shallow(<CmFeedback
1717
jobId = {1}
18-
cfFeedbackValue={cfFeedbackResult}
18+
cfFeedbackValue={cmFeedbackResult}
1919
isCfFeedbackValuesLoaded={true}
2020
isRetrainValuesLoaded={true}
2121
isEncodedUniqueValuesLoaded={true}
2222
retrainValue={retrainResult}
2323
featureNames={getFeatureNames(uniqueEncodedDecodedValues)}
24-
patterns={encodePatternsForDropdown(cfFeedbackResult[1])}
24+
patterns={encodePatternsForDropdown(cmFeedbackResult[1])}
2525
featureValues={getUniqueFeatureValues(uniqueEncodedDecodedValues)}
2626
onSubmitTopK={onSubmitTopK}
2727
onSubmitFeatureNamesAndValues={onSubmitFeatureNamesAndValues}/>);
@@ -38,15 +38,15 @@ describe('CfFeedback result', () => {
3838
});
3939

4040
it('None of the data loaded', () => {
41-
const element = shallow(<CfFeedback
41+
const element = shallow(<CmFeedback
4242
jobId = {1}
43-
cfFeedbackValue={cfFeedbackResult}
43+
cfFeedbackValue={cmFeedbackResult}
4444
isCfFeedbackValuesLoaded={false}
4545
isRetrainValuesLoaded={false}
4646
isEncodedUniqueValuesLoaded={false}
4747
retrainValue={retrainResult}
4848
featureNames={getFeatureNames(uniqueEncodedDecodedValues)}
49-
patterns={encodePatternsForDropdown(cfFeedbackResult[1])}
49+
patterns={encodePatternsForDropdown(cmFeedbackResult[1])}
5050
featureValues={getUniqueFeatureValues(uniqueEncodedDecodedValues)}
5151
onSubmitTopK={onSubmitTopK}
5252
onSubmitFeatureNamesAndValues={onSubmitFeatureNamesAndValues}/>);

src/__tests__/components/explanation/CfFeedbackResultTable.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import React from 'react';
22
import {shallow} from 'enzyme';
33
import {DataTable, TableBody, TableColumn, TableHeader, TablePagination, TableRow} from 'react-md/lib/DataTables/index';
44
import CfFeedbackResultTable from '../../../components/explanation/CfFeedbackResultTable';
5-
import {cfFeedbackResult} from '../../../../stories/Explanation';
5+
import {cmFeedbackResult} from '../../../../stories/Explanation';
66
import {SelectField} from 'react-md';
77

88
const onSelectedMatrixChange = jest.fn();
99

1010
describe('Cf feedback result Table', () => {
1111
it('renders', () => {
1212
const element = shallow(<CfFeedbackResultTable
13-
cfFeedbackResult={cfFeedbackResult[1]}
13+
cfFeedbackResult={cmFeedbackResult[1]}
1414
onSelectedMatrixChange={onSelectedMatrixChange}
1515
selectedMatrix={'All'}
1616
/>);

src/__tests__/components/explanation/CfFeedbackResulttTable.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import React from 'react';
22
import {shallow} from 'enzyme';
33
import {DataTable, TableBody, TableColumn, TableHeader, TablePagination, TableRow} from 'react-md/lib/DataTables/index';
44
import CfFeedbackResulttTable from '../../../components/explanation/CfFeedbackResulttTable';
5-
import {cfFeedbackResult} from '../../../../stories/Explanation';
5+
import {cmFeedbackResult} from '../../../../stories/Explanation';
66
import {SelectField} from 'react-md';
77

88
const onSelectedMatrixChange = jest.fn();
99

1010
describe('Cf feedback result Table', () => {
1111
it('renders', () => {
1212
const element = shallow(<CfFeedbackResulttTable
13-
cfFeedbackResult={cfFeedbackResult[1]}
13+
cfFeedbackResult={cmFeedbackResult[1]}
1414
onSelectedMatrixChange={onSelectedMatrixChange}
1515
selectedMatrix={'All'}
1616
/>);

src/__tests__/reducers/Explanation.test.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import {limeValueListRequested, limeValueListRetrieved, limeValueListFailed,
33
shapValueListFailed, shapValueListRequested, shapValueListRetrieved,
44
iceValueListFailed, iceValueListRequested, iceValueListRetrieved,
55
skaterValueListFailed, skaterValueListRequested, skaterValueListRetrieved,
6-
cffeedbackValueListFailed, cffeedbackValueListRequested, cffeedbackValueListRetrieved,
6+
cmfeedbackValueListFailed, cmfeedbackValueListRequested, cmfeedbackValueListRetrieved,
77
retrainValueListFailed, retrainValueListRequested,
88
retrainValueListRetrieved} from '../../actions/ExplanationActions';
99
import {limeList, shapResult, iceResultList, skaterResult,
10-
retrainResult, cfFeedbackResult} from '../../../stories/Explanation';
10+
retrainResult, cmFeedbackResult} from '../../../stories/Explanation';
1111

1212

1313
const initialState = {
@@ -16,13 +16,13 @@ const initialState = {
1616
shapValueList: {},
1717
iceValueList: {},
1818
skaterValueList: {},
19-
cfFeedbackValue: {},
19+
cmFeedbackValue: {},
2020
retrainValue: {},
2121
isLimeValuesLoaded: true,
2222
isShapValuesLoaded: true,
2323
isSkaterValuesLoaded: true,
2424
isIceValuesLoaded: true,
25-
isCfFeedbackLoaded: true,
25+
isCmFeedbackLoaded: true,
2626
isRetrainLoaded: true,
2727
};
2828

@@ -123,46 +123,46 @@ describe('Explanation reducer', () => {
123123
});
124124
});
125125

126-
describe('CfFeedback Value requested', () => {
127-
const stateWithRequest = explanation(undefined, cffeedbackValueListRequested());
126+
describe('CmFeedback Value requested', () => {
127+
const stateWithRequest = explanation(undefined, cmfeedbackValueListRequested());
128128

129-
it('changes fetchState when CfFeedback requesting', () => {
129+
it('changes fetchState when CmFeedback requesting', () => {
130130
expect(stateWithRequest.fetchState).toEqual({inFlight: true});
131-
expect(stateWithRequest.isCfFeedbackLoaded).toEqual(false);
131+
expect(stateWithRequest.isCmFeedbackLoaded).toEqual(false);
132132
});
133133

134-
it('changes fetchState when CfFeedback request completed', () => {
135-
const state2 = explanation(stateWithRequest, cffeedbackValueListRetrieved(cfFeedbackResult));
134+
it('changes fetchState when CmFeedback request completed', () => {
135+
const state2 = explanation(stateWithRequest, cmfeedbackValueListRetrieved(cmFeedbackResult));
136136
expect(state2.fetchState).toEqual({inFlight: false});
137-
expect(state2.isCfFeedbackLoaded).toEqual(true);
138-
const {cfFeedbackValue} = state2;
139-
expect(cfFeedbackValue).toEqual(cfFeedbackResult[1]);
137+
expect(state2.isCmFeedbackLoaded).toEqual(true);
138+
const {cmFeedbackValue} = state2;
139+
expect(cmFeedbackValue).toEqual(cmFeedbackResult[1]);
140140
});
141141

142-
it('changes fetchState when CfFeedback request failed', () => {
143-
const state2 = explanation(stateWithRequest, cffeedbackValueListFailed('error'));
142+
it('changes fetchState when CmFeedback request failed', () => {
143+
const state2 = explanation(stateWithRequest, cmfeedbackValueListFailed('error'));
144144
expect(state2.fetchState).toEqual({inFlight: false, error: 'error'});
145-
expect(state2.isCfFeedbackLoaded).toEqual(true);
145+
expect(state2.isCmFeedbackLoaded).toEqual(true);
146146
});
147147
});
148148

149149
describe('Retrain Value requested', () => {
150150
const stateWithRequest = explanation(undefined, retrainValueListRequested());
151151

152-
it('changes fetchState when CfFeedback requesting', () => {
152+
it('changes fetchState when CmFeedback requesting', () => {
153153
expect(stateWithRequest.fetchState).toEqual({inFlight: true});
154154
expect(stateWithRequest.isRetrainLoaded).toEqual(false);
155155
});
156156

157-
it('changes fetchState when CfFeedback request completed', () => {
157+
it('changes fetchState when CmFeedback request completed', () => {
158158
const state2 = explanation(stateWithRequest, retrainValueListRetrieved(retrainResult));
159159
expect(state2.fetchState).toEqual({inFlight: false});
160160
expect(state2.isRetrainLoaded).toEqual(true);
161161
const {retrainValue} = state2;
162162
expect(retrainValue).toEqual(retrainResult[1]);
163163
});
164164

165-
it('changes fetchState when CfFeedback request failed', () => {
165+
it('changes fetchState when CmFeedback request failed', () => {
166166
const state2 = explanation(stateWithRequest, retrainValueListFailed('error'));
167167
expect(state2.fetchState).toEqual({inFlight: false, error: 'error'});
168168
expect(state2.isRetrainLoaded).toEqual(true);

src/actions/ExplanationActions.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ export const skaterValueListRetrieved = createPayloadForwardingAction(SKATER_VAL
2727
export const SKATER_VALUE_LIST_FAILED = 'SKATER_VALUE_LIST_FAILED';
2828
export const skaterValueListFailed = createPayloadForwardingAction(SKATER_VALUE_LIST_FAILED);
2929

30-
export const CFFEEDBACK_VALUE_LIST_REQUESTED = 'CFFEEFBACK_VALUE_LIST_REQUESTED';
31-
export const cffeedbackValueListRequested = createPayloadForwardingAction(CFFEEDBACK_VALUE_LIST_REQUESTED);
32-
export const CFFEEFBACK_VALUE_LIST_RETRIEVED = 'CFFEEFBACK_VALUE_LIST_RETRIEVED';
33-
export const cffeedbackValueListRetrieved = createPayloadForwardingAction(CFFEEFBACK_VALUE_LIST_RETRIEVED);
34-
export const CFFEEFBACK_VALUE_LIST_FAILED = 'CFFEEFBACK_VALUE_LIST_FAILED';
35-
export const cffeedbackValueListFailed = createPayloadForwardingAction(CFFEEFBACK_VALUE_LIST_FAILED);
30+
export const CMFEEDBACK_VALUE_LIST_REQUESTED = 'CMFEEFBACK_VALUE_LIST_REQUESTED';
31+
export const cmfeedbackValueListRequested = createPayloadForwardingAction(CMFEEDBACK_VALUE_LIST_REQUESTED);
32+
export const CMFEEFBACK_VALUE_LIST_RETRIEVED = 'CMFEEFBACK_VALUE_LIST_RETRIEVED';
33+
export const cmfeedbackValueListRetrieved = createPayloadForwardingAction(CMFEEFBACK_VALUE_LIST_RETRIEVED);
34+
export const CMFEEFBACK_VALUE_LIST_FAILED = 'CMFEEFBACK_VALUE_LIST_FAILED';
35+
export const cmfeedbackValueListFailed = createPayloadForwardingAction(CMFEEFBACK_VALUE_LIST_FAILED);
3636

3737

3838
export const RETRAIN_VALUE_LIST_REQUESTED = 'RETRAIN_VALUE_LIST_REQUESTED';

src/actions/ServerActions.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {temporalLimePredictionListRetrieved, temporalLimePredictionListFailed,
1313
temporalPredictionListRetrieved, temporalPredictionListFailed} from './PredictionAction';
1414
import {shapValueListRetrieved, shapValueListFailed, skaterValueListRetrieved,
1515
skaterValueListFailed, iceValueListFailed, iceValueListRetrieved,
16-
cffeedbackValueListRetrieved, cffeedbackValueListFailed, retrainValueListRetrieved,
16+
cmfeedbackValueListRetrieved, cmfeedbackValueListFailed, retrainValueListRetrieved,
1717
retrainValueListFailed} from './ExplanationActions';
1818

1919
export const getJobs = () => (dispatch) => {
@@ -207,15 +207,15 @@ export const getIceValues = ({jobId, attribute}) => (dispatch) => {
207207
);
208208
};
209209

210-
export const getCfFeedbackValues = ({jobId, attribute}) => (dispatch) => {
210+
export const getCmFeedbackValues = ({jobId, attribute}) => (dispatch) => {
211211
jsonAjax(
212-
SERVER_URL + `/explanation/cffeedback/${jobId}&${attribute}/`,
212+
SERVER_URL + `/explanation/cmfeedback/${jobId}&${attribute}/`,
213213
'GET',
214214
null,
215-
(resul) => {
216-
dispatch(cffeedbackValueListRetrieved(resul));
215+
(result) => {
216+
dispatch(cmfeedbackValueListRetrieved(result));
217217
},
218-
({error}) => dispatch(cffeedbackValueListFailed(error))
218+
({error}) => dispatch(cmfeedbackValueListFailed(error))
219219
);
220220
};
221221

@@ -224,8 +224,8 @@ export const getRetrainValues = ({jobId, data}) => (dispatch) => {
224224
SERVER_URL + `/explanation/retrain/${jobId}/`,
225225
'POST',
226226
data,
227-
(resul) => {
228-
dispatch(retrainValueListRetrieved(resul));
227+
(result) => {
228+
dispatch(retrainValueListRetrieved(result));
229229
},
230230
({error}) => dispatch(retrainValueListFailed(error))
231231
);

src/components/explanation/CmFeedback.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {Row} from 'react-grid-system';
99
import RetrainResultTable from './RetrainResultTable';
1010
import {getFeatureNamesAndValueFromSelectedPatterns} from '../../util/dataReducers';
1111

12-
class CfFeedback extends PureComponent {
12+
class CmFeedback extends PureComponent {
1313
constructor(props) {
1414
super(props);
1515
let removedIndexFeatures = [];
@@ -348,7 +348,7 @@ class CfFeedback extends PureComponent {
348348
);
349349
}
350350
}
351-
CfFeedback.propTypes = {
351+
CmFeedback.propTypes = {
352352
jobId: PropTypes.any,
353353
cfFeedbackValue: PropTypes.any,
354354
isCfFeedbackValuesLoaded: PropTypes.bool,
@@ -361,4 +361,4 @@ CfFeedback.propTypes = {
361361
onSubmitTopK: PropTypes.func,
362362
onSubmitFeatureNamesAndValues: PropTypes.func,
363363
};
364-
export default CfFeedback;
364+
export default CmFeedback;

src/middlewares/ServerMiddleware.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
getIceValues,
1818
getSkaterValues,
1919
getDecodingDf,
20-
getCfFeedbackValues,
20+
getCmFeedbackValues,
2121
getRetrainValues,
2222
getEncodedUniqueValues
2323
} from '../actions/ServerActions';
@@ -27,7 +27,7 @@ import {TRACE_LIST_REQUESTED} from '../actions/TraceActions';
2727
import {LOG_INFO_REQUESTED, LOG_LIST_REQUESTED} from '../actions/LogActions';
2828
import {LIME_VALUE_LIST_REQUESTED, SHAP_VALUE_LIST_REQUESTED,
2929
ICE_VALUE_LIST_REQUESTED, SKATER_VALUE_LIST_REQUESTED,
30-
CFFEEDBACK_VALUE_LIST_REQUESTED, RETRAIN_VALUE_LIST_REQUESTED} from '../actions/ExplanationActions';
30+
CMFEEDBACK_VALUE_LIST_REQUESTED, RETRAIN_VALUE_LIST_REQUESTED} from '../actions/ExplanationActions';
3131
import {SPLIT_SUBMITTED, SPLITS_REQUESTED} from '../actions/SplitActions';
3232
import {MODELS_REQUESTED} from '../actions/ModelActions';
3333
import {PREDICTION_SUBMITTED, REPLAY_SUBMITTED} from '../actions/RuntimeActions';
@@ -54,7 +54,7 @@ const ACTION_TYPE_TO_SERVER_ACTION = {
5454
[TEMPORAL_STABILITY_PREDICTION_LIST_REQUESTED]: getPredictionTemporalStabilityValues,
5555
[DECODING_REQUESTED]: getDecodingDf,
5656
[ENCODED_UNIQUE_VALUES_REQUESTED]: getEncodedUniqueValues,
57-
[CFFEEDBACK_VALUE_LIST_REQUESTED]: getCfFeedbackValues,
57+
[CMFEEDBACK_VALUE_LIST_REQUESTED]: getCmFeedbackValues,
5858
[RETRAIN_VALUE_LIST_REQUESTED]: getRetrainValues,
5959
};
6060

0 commit comments

Comments
 (0)