equinor / webviz-subsurface

Webviz-config plugins for subsurface data.
https://github.com/orgs/equinor/projects/24
GNU General Public License v3.0
56 stars 59 forks source link

Fix pylint reported conventions and refactor proposals #1281

Closed andreas-el closed 4 months ago

andreas-el commented 5 months ago
************* Module /home/runner/work/webviz-subsurface/webviz-subsurface/.pylintrc
.pylintrc:1:0: R0022: Useless option value for '--disable', 'bad-continuation' was removed from pylint, see https://github.com/pylint-dev/pylint/pull/3571. (useless-option-value)
************* Module webviz_subsurface._components.color_picker
webviz_subsurface/_components/color_picker.py:177:22: R1735: Consider using '{"hex": current_color_store[row_no]}' instead of a call to 'dict'. (use-dict-literal)
************* Module webviz_subsurface._components.tornado._tornado_bar_chart
webviz_subsurface/_components/tornado/_tornado_bar_chart.py:143:12: R1735: Consider using '{"type": 'bar', "y": self._tornadotable['sensname'], "x": self._tornadotable['low'], ... }' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/_components/tornado/_tornado_bar_chart.py:163:12: R1735: Consider using '{"type": 'bar', "y": self._tornadotable['sensname'], "x": self._tornadotable['high'], ... }' instead of a call to 'dict'. (use-dict-literal)
************* Module webviz_subsurface._datainput.units
webviz_subsurface/_datainput/units.py:155:0: I0021: Useless suppression of 'super-init-not-called' (useless-suppression)
************* Module webviz_subsurface._datainput.eclipse_init_io.pvt_gas
webviz_subsurface/_datainput/eclipse_init_io/pvt_gas.py:530:19: C2801: Unnecessarily calls dunder method __getitem__. Access item via subscript. (unnecessary-dunder-call)
webviz_subsurface/_datainput/eclipse_init_io/pvt_gas.py:538:19: C2801: Unnecessarily calls dunder method __getitem__. Access item via subscript. (unnecessary-dunder-call)
webviz_subsurface/_datainput/eclipse_init_io/pvt_gas.py:539:14: C2801: Unnecessarily calls dunder method __getitem__. Access item via subscript. (unnecessary-dunder-call)
webviz_subsurface/_datainput/eclipse_init_io/pvt_gas.py:550:19: C2801: Unnecessarily calls dunder method __getitem__. Access item via subscript. (unnecessary-dunder-call)
************* Module webviz_subsurface._datainput.eclipse_init_io.pvt_water
webviz_subsurface/_datainput/eclipse_init_io/pvt_water.py:397:19: C2801: Unnecessarily calls dunder method __getitem__. Access item via subscript. (unnecessary-dunder-call)
webviz_subsurface/_datainput/eclipse_init_io/pvt_water.py:405:19: C2801: Unnecessarily calls dunder method __getitem__. Access item via subscript. (unnecessary-dunder-call)
webviz_subsurface/_datainput/eclipse_init_io/pvt_water.py:406:14: C2801: Unnecessarily calls dunder method __getitem__. Access item via subscript. (unnecessary-dunder-call)
************* Module webviz_subsurface._datainput.eclipse_init_io.pvt_oil
webviz_subsurface/_datainput/eclipse_init_io/pvt_oil.py:756:19: C2801: Unnecessarily calls dunder method __getitem__. Access item via subscript. (unnecessary-dunder-call)
webviz_subsurface/_datainput/eclipse_init_io/pvt_oil.py:758:19: C2801: Unnecessarily calls dunder method __getitem__. Access item via subscript. (unnecessary-dunder-call)
webviz_subsurface/_datainput/eclipse_init_io/pvt_oil.py:763:19: C2801: Unnecessarily calls dunder method __getitem__. Access item via subscript. (unnecessary-dunder-call)
webviz_subsurface/_datainput/eclipse_init_io/pvt_oil.py:764:14: C2801: Unnecessarily calls dunder method __getitem__. Access item via subscript. (unnecessary-dunder-call)
************* Module webviz_subsurface._datainput.eclipse_init_io.pvt_common
webviz_subsurface/_datainput/eclipse_init_io/pvt_common.py:635:14: C2801: Unnecessarily calls dunder method __getitem__. Access item via subscript. (unnecessary-dunder-call)
webviz_subsurface/_datainput/eclipse_init_io/pvt_common.py:636:10: C2801: Unnecessarily calls dunder method __getitem__. Access item via subscript. (unnecessary-dunder-call)
webviz_subsurface/_datainput/eclipse_init_io/pvt_common.py:643:15: C2801: Unnecessarily calls dunder method __getitem__. Access item via subscript. (unnecessary-dunder-call)
************* Module webviz_subsurface.plugins._surface_with_grid_cross_section
webviz_subsurface/plugins/_surface_with_grid_cross_section.py:347:20: R1728: Consider using a generator instead 'sum(len(subgrid) for subgrid in grid.subgrids.values())' (consider-using-generator)
************* Module webviz_subsurface.plugins._reservoir_simulation_timeseries_onebyone
webviz_subsurface/plugins/_reservoir_simulation_timeseries_onebyone.py:597:19: R1728: Consider using a generator instead 'min(min(trace['y']) for trace in figure['data'])' (consider-using-generator)
webviz_subsurface/plugins/_reservoir_simulation_timeseries_onebyone.py:598:19: R1728: Consider using a generator instead 'max(max(trace['y']) for trace in figure['data'])' (consider-using-generator)
************* Module webviz_subsurface.plugins._seismic_misfit
webviz_subsurface/plugins/_seismic_misfit.py:2117:33: R1735: Consider using '{"l": 20, "r": 20, "t": 30, "b": 20}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2276:29: R1735: Consider using '{"size": marker_size}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2276:62: R1735: Consider using '{"mode": 'markers'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2353:19: R1735: Consider using '{"size": marker_size, "color": ensdf['obs'], "colorscale": color_scale, ... }' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2382:19: R1735: Consider using '{"size": marker_size, "color": ensdf_stat['sim_mean'], "colorscale": color_scale, ... }' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2412:23: R1735: Consider using '{"size": marker_size, "color": ensdf_stat['diff_mean'], "cmin": 0}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2442:23: R1735: Consider using '{"size": marker_size, "color": ensdf_stat[coverage], "cmin": -1.0}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2448:29: R1735: Consider using '{"tickvals": [-0.5, 0.5, 1.5], "ticktext": ['Overmodelled', 'Coverage', 'Undermodelled'], ... }' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2477:23: R1735: Consider using '{"size": marker_size, "color": ensdf.region, "colorscale": px.colors.qualitative.Plotly, ... }' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2553:27: R1735: Consider using '{"color": 'red', "size": 5}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2554:25: R1735: Consider using '{"width": 2, "dash": 'solid'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2562:27: R1735: Consider using '{"color": 'green', "size": 3}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2563:25: R1735: Consider using '{"width": 1, "dash": 'dot'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2571:27: R1735: Consider using '{"color": '#444'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2572:25: R1735: Consider using '{"width": 1}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2579:27: R1735: Consider using '{"color": '#444'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2580:25: R1735: Consider using '{"width": 1}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2591:25: R1735: Consider using '{"width": 1, "dash": 'dot', "color": 'grey'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2599:25: R1735: Consider using '{"width": 1, "dash": 'dot', "color": 'grey'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2633:27: R1735: Consider using '{"color": 'red', "size": 7}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2634:25: R1735: Consider using '{"width": 5, "dash": 'solid'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2648:29: R1735: Consider using '{"width": 1, "dash": 'dash'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2761:29: R1735: Consider using '{"sizemode": 'area'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2784:19: R1735: Consider using '{"line": dict(width=0.4, color='black')}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2784:29: R1735: Consider using '{"width": 0.4, "color": 'black'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2785:21: R1735: Consider using '{"mode": 'markers'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2896:54: R1735: Consider using '{"type": 'scatter'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2900:8: R1735: Consider using '{"type": 'data', "array": df_stat['obs_error'], "visible": True, "thickness": 1.0, ... }' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2972:21: R1735: Consider using '{"type": 'data', "array": ensdf_stat[ens_name]['sim_std'], "visible": True, ... }' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:2985:21: R1735: Consider using '{"type": 'data', "symmetric": False, "array": ensdf_stat[ens_name]['error_plus'], ... }' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_seismic_misfit.py:3011:28: R1735: Consider using '{"type": 'data', "array": ensdf_stat[ens_name]['obs_error'], "visible": True, ... }' instead of a call to 'dict'. (use-dict-literal)
************* Module webviz_subsurface.plugins._running_time_analysis_fmu
webviz_subsurface/plugins/_running_time_analysis_fmu.py:525:15: R1728: Consider using a generator instead 'max(len(param) for param in params)' (consider-using-generator)
************* Module webviz_subsurface.plugins._vfp_analysis._views._vfp_view._utils._vfp_figure_builder
webviz_subsurface/plugins/_vfp_analysis/_views/_vfp_view/_utils/_vfp_figure_builder.py:71:26: R1735: Consider using '{"cmax": cmax, "cmin": cmin, "cmid": (cmin + cmax) / 2, "color": [cvalue] * len(rates), ... }' instead of a call to 'dict'. (use-dict-literal)
************* Module webviz_subsurface.plugins._group_tree._utils._ensemble_group_tree_data
webviz_subsurface/plugins/_group_tree/_utils/_ensemble_group_tree_data.py:595:22: R1728: Consider using a generator instead 'sum(smry[sumvec].sum() for sumvec in prod_sumvecs if sumvec in smry.columns)' (consider-using-generator)
webviz_subsurface/plugins/_group_tree/_utils/_ensemble_group_tree_data.py:603:21: R1728: Consider using a generator instead 'sum(smry[sumvec].sum() for sumvec in inj_sumvecs if sumvec in smry.columns)' (consider-using-generator)
webviz_subsurface/plugins/_group_tree/_utils/_ensemble_group_tree_data.py:415:0: I0021: Useless suppression of 'too-many-locals' (useless-suppression)
************* Module webviz_subsurface.plugins._volumetric_analysis.utils.table_and_figure_utils
webviz_subsurface/plugins/_volumetric_analysis/utils/table_and_figure_utils.py:114:11: R1735: Consider using '{"visible": bool(selections['Fluid annotation']) and selections['Subplots'] != 'FLUID_ZONE', ... }' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_volumetric_analysis/utils/table_and_figure_utils.py:123:13: R1735: Consider using '{"size": 15, "color": 'black'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_volumetric_analysis/utils/table_and_figure_utils.py:138:13: R1735: Consider using '{"color": 'black', "width": 2, "dash": 'dash'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_volumetric_analysis/utils/table_and_figure_utils.py:159:15: R1728: Consider using a generator instead 'max(max(abs(trace.x)) for fig in figures for trace in fig.data)' (consider-using-generator)
************* Module webviz_subsurface.plugins._volumetric_analysis.controllers.distribution_controllers
webviz_subsurface/plugins/_volumetric_analysis/controllers/distribution_controllers.py:120:23: R1735: Consider using '{"title": dict(text=f"{volume_description(selections['X Response'])}" + (f" [{volume_unit(selections['X Response'])}]" if selections['X Response'] in volumemodel.volume_columns else ''), x=0.5, xref='paper', font=dict(size=18)), ... }' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_volumetric_analysis/controllers/distribution_controllers.py:121:26: R1735: Consider using '{"text": f"{volume_description(selections['X Response'])}" + (f" [{volume_unit(selections['X Response'])}]" if selections['X Response'] in volumemodel.volume_columns else ''), ... }' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_volumetric_analysis/controllers/distribution_controllers.py:133:29: R1735: Consider using '{"size": 18}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_volumetric_analysis/controllers/distribution_controllers.py:136:22: R1735: Consider using '{"showticklabels": True}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_volumetric_analysis/controllers/distribution_controllers.py:239:47: R1735: Consider using '{"color": '#000000', "width": 1}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_volumetric_analysis/controllers/distribution_controllers.py:240:42: R1735: Consider using '{"l": 10, "b": 10}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_volumetric_analysis/controllers/distribution_controllers.py:255:22: R1735: Consider using '{"type": 'category', "tickangle": 45, "tickfont_size": 17, "title": None, ... }' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_volumetric_analysis/controllers/distribution_controllers.py:330:22: R1735: Consider using '{"showticklabels": True}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_volumetric_analysis/controllers/distribution_controllers.py:342:21: R1735: Consider using '{"color": 'firebrick', "dash": 'dash'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_volumetric_analysis/controllers/distribution_controllers.py:345:21: R1735: Consider using '{"color": 'royalblue', "dash": 'dash'}' instead of a call to 'dict'. (use-dict-literal)
************* Module webviz_subsurface.plugins._volumetric_analysis.controllers.tornado_controllers
webviz_subsurface/plugins/_volumetric_analysis/controllers/tornado_controllers.py:161:0: C0301: Line too long (103/100) (line-too-long)
************* Module webviz_subsurface.plugins._line_plotter_fmu.figures.plotly_line_plot
webviz_subsurface/plugins/_line_plotter_fmu/figures/plotly_line_plot.py:210:15: R1735: Consider using '{"layout": self._layout, "data": traces}' instead of a call to 'dict'. (use-dict-literal)
************* Module webviz_subsurface.plugins._prod_misfit.utils.make_figures
webviz_subsurface/plugins/_prod_misfit/utils/make_figures.py:246:24: R1735: Consider using '{"Oil": 'OIL_MISFIT', "Water": 'WAT_MISFIT', "Gas": 'GAS_MISFIT'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_prod_misfit/utils/make_figures.py:247:16: R1735: Consider using '{"Oil": 'DIFF_WOPT', "Water": 'DIFF_WWPT', "Gas": 'DIFF_WGPT'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_prod_misfit/utils/make_figures.py:248:12: R1735: Consider using '{"Oil": '#2ca02c', "Water": '#1f77b4', "Gas": '#d62728'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_prod_misfit/utils/make_figures.py:313:29: R1735: Consider using '{"l": 20, "r": 20, "t": 30, "b": 20}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface.plugins._swatinit_qc._markdown:49: DeprecationWarning: invalid escape sequence \*
webviz_subsurface/plugins/_prod_misfit/utils/make_figures.py:345:18: R1735: Consider using '{"value": f'{phase} diff (sim-obs)', "variable": 'Well name'}' instead of a call to 'dict'. (use-dict-literal)
************* Module webviz_subsurface.plugins._pvt_plot._views._pvt._settings._data_settings
webviz_subsurface/plugins/_pvt_plot/_views/_pvt/_settings/_data_settings.py:58:36: R1735: Consider using '{"id": self.register_component_unique_id(DataSettings.Ids.ENSEMBLES), ... }' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/plugins/_pvt_plot/_views/_pvt/_settings/_data_settings.py:64:34: R1735: Consider using '{"id": self.register_component_unique_id(DataSettings.Ids.PVTNUM)}' instead of a call to 'dict'. (use-dict-literal)
************* Module webviz_subsurface.plugins._map_viewer_fmu.callbacks
webviz_subsurface/plugins/_map_viewer_fmu/callbacks.py:543:32: R1736: Unnecessary list index lookup, use 'data' instead (unnecessary-list-index-lookup)
webviz_subsurface/plugins/_map_viewer_fmu/callbacks.py:561:48: R1736: Unnecessary list index lookup, use 'data' instead (unnecessary-list-index-lookup)
webviz_subsurface/plugins/_map_viewer_fmu/callbacks.py:1044:13: R1728: Consider using a generator instead 'min(x for x in range(1, 20, 1) if x * x >= views)' (consider-using-generator)
************* Module webviz_subsurface.plugins._well_analysis._views._well_control_view._utils._well_control_figure
webviz_subsurface/plugins/_well_analysis/_views/_well_control_view/_utils/_well_control_figure.py:165:0: I0021: Useless suppression of 'too-many-locals' (useless-suppression)
************* Module webviz_subsurface._figures.scatterplot
webviz_subsurface/_figures/scatterplot.py:79:21: R1735: Consider using '{"dash": dash, "color": color}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/_figures/scatterplot.py:113:42: R1735: Consider using '{"orientation": 'h'}' instead of a call to 'dict'. (use-dict-literal)
************* Module webviz_subsurface._figures.px_figure
webviz_subsurface/_figures/px_figure.py:132:55: R1735: Consider using '{"type": 'pie'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/_figures/px_figure.py:142:21: R1735: Consider using '{"type": 'histogram'}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/_figures/px_figure.py:157:33: R1735: Consider using '{"color": trace.marker.color, "width": 1}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/_figures/px_figure.py:183:15: R1735: Consider using '{"xaxis": {'visible': False}, "yaxis": {'visible': False}, "plot_bgcolor": 'white', ... }' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/_figures/px_figure.py:188:16: R1735: Consider using '{"text": 'No data available for figure', "xref": 'paper', "yref": 'paper', ... }' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/_figures/px_figure.py:249:27: R1735: Consider using '{"bgcolor": '#E6FAEC', "font": dict(color='#243746', size=15)}' instead of a call to 'dict'. (use-dict-literal)
webviz_subsurface/_figures/px_figure.py:249:56: R1735: Consider using '{"color": '#243746', "size": 15}' instead of a call to 'dict'. (use-dict-literal)
************* Module webviz_subsurface._providers.ensemble_summary_provider._resampling
webviz_subsurface/_providers/ensemble_summary_provider/_resampling.py:77:0: I0021: Useless suppression of 'invalid-name' (useless-suppression)
webviz_subsurface/_providers/ensemble_summary_provider/_resampling.py:256:0: I0021: Useless suppression of 'invalid-name' (useless-suppression)

-----------------------------------
Your code has been rated at 9.97/10