Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve linting errors on Possibly using variable before assignment #334

Open
2 tasks
k-knosala opened this issue May 21, 2024 · 0 comments
Open
2 tasks

Solve linting errors on Possibly using variable before assignment #334

k-knosala opened this issue May 21, 2024 · 0 comments

Comments

@k-knosala
Copy link
Collaborator

  • Remove possibly-used-before-assignment from ignored rules in pylintrc-critical-only
  • Solve the linting errors below
Run pylint --rcfile pylintrc-critical-only $(git ls-files '*.py')
  pylint --rcfile pylintrc-critical-only $(git ls-files '*.py')
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.11.9/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.9/x64/lib
************* Module hisim.components.advanced_fuel_cell_controller
hisim/components/advanced_fuel_cell_controller.py:156:11: E0606: Possibly using variable 'temperature_upper_sensor' before assignment (possibly-used-before-assignment)
hisim/components/advanced_fuel_cell_controller.py:162:15: E0606: Possibly using variable 'temperature_lower_sensor' before assignment (possibly-used-before-assignment)
hisim/components/advanced_fuel_cell_controller.py:211:11: E0606: Possibly using variable 'temperature_upper_sensor' before assignment (possibly-used-before-assignment)
hisim/components/advanced_fuel_cell_controller.py:217:15: E0606: Possibly using variable 'temperature_lower_sensor' before assignment (possibly-used-before-assignment)
************* Module hisim.components.air_conditioner
hisim/components/air_conditioner.py:707:50: E0606: Possibly using variable 'state' before assignment (possibly-used-before-assignment)
************* Module hisim.components.building
hisim/components/building.py:1251:12: E0606: Possibly using variable 'external_part_of_transmission_heat_transfer_coeff_opaque_elements_in_watt_per_kelvin' before assignment (possibly-used-before-assignment)
hisim/components/building.py:1730:58: E0606: Possibly using variable 'indoor_air_temperature_set_in_celsius' before assignment (possibly-used-before-assignment)
hisim/components/building.py:2223:15: E0606: Possibly using variable 'number_of_apartments' before assignment (possibly-used-before-assignment)
************* Module hisim.components.controller_l1_heat_old
hisim/components/controller_l1_heat_old.py:331:11: E0606: Possibly using variable 'control_signal_choose_storage' before assignment (possibly-used-before-assignment)
************* Module hisim.components.controller_mpc
hisim/components/controller_mpc.py:811:87: E0606: Possibly using variable 'optvar_power_sold_to_grid' before assignment (possibly-used-before-assignment)
hisim/components/controller_mpc.py:874:76: E0606: Possibly using variable 'pv_production' before assignment (possibly-used-before-assignment)
hisim/components/controller_mpc.py:878:28: E0606: Possibly using variable 'optvar_power_pv' before assignment (possibly-used-before-assignment)
hisim/components/controller_mpc.py:1309:49: E0606: Possibly using variable 'applied_optimal_solution_index' before assignment (possibly-used-before-assignment)
************* Module hisim.components.controller_pid
hisim/components/controller_pid.py:496:24: E0606: Possibly using variable 'time_constant_tm' before assignment (possibly-used-before-assignment)
************* Module hisim.components.generic_car
hisim/components/generic_car.py:238:22: E0601: Using variable 'opex_cost_per_simulated_period_in_euro' before assignment (used-before-assignment)
hisim/components/generic_car.py:239:26: E0601: Using variable 'co2_per_simulated_period_in_kg' before assignment (used-before-assignment)
************* Module hisim.components.generic_electrolyzer_h2
hisim/components/generic_electrolyzer_h2.py:84:19: E0606: Possibly using variable 'data_for_specific_electrolyzer' before assignment (possibly-used-before-assignment)
************* Module hisim.components.generic_ev_charger
hisim/components/generic_ev_charger.py:253:42: E0606: Possibly using variable 'convert_factor' before assignment (possibly-used-before-assignment)
hisim/components/generic_ev_charger.py:273:63: E0606: Possibly using variable 'battery_stored_energy_meters' before assignment (possibly-used-before-assignment)
hisim/components/generic_ev_charger.py:979:50: E0606: Possibly using variable 'state' before assignment (possibly-used-before-assignment)
************* Module hisim.components.generic_heat_pump
hisim/components/generic_heat_pump.py:727:50: E0606: Possibly using variable 'state' before assignment (possibly-used-before-assignment)
************* Module hisim.components.generic_heat_pump_modular
hisim/components/generic_heat_pump_modular.py:384:32: E0601: Using variable 'power_modifier' before assignment (used-before-assignment)
************* Module hisim.components.generic_price_signal
hisim/components/generic_price_signal.py:237:55: E0606: Possibly using variable 'price_injection' before assignment (possibly-used-before-assignment)
************* Module hisim.components.generic_rsoc
hisim/components/generic_rsoc.py:632:49: E0601: Using variable 'h2_production_rate' before assignment (used-before-assignment)
************* Module hisim.components.generic_smart_device
hisim/components/generic_smart_device.py:366:41: E0606: Possibly using variable 'euro_per_unit' before assignment (possibly-used-before-assignment)
hisim/components/generic_smart_device.py:367:45: E0606: Possibly using variable 'co2_per_unit' before assignment (possibly-used-before-assignment)
************* Module hisim.components.loadprofilegenerator_utsp_connector
hisim/components/loadprofilegenerator_utsp_connector.py:1178:50: E0606: Possibly using variable 'electricity_consumption_list' before assignment (possibly-used-before-assignment)
hisim/components/loadprofilegenerator_utsp_connector.py:1179:44: E0606: Possibly using variable 'water_consumption_list' before assignment (possibly-used-before-assignment)
hisim/components/loadprofilegenerator_utsp_connector.py:1180:50: E0606: Possibly using variable 'inner_device_heat_gains_list' before assignment (possibly-used-before-assignment)
************* Module hisim.components.more_advanced_heat_pump_hplib
hisim/components/more_advanced_heat_pump_hplib.py:832:56: E0606: Possibly using variable 'on_off_dhw' before assignment (possibly-used-before-assignment)
hisim/components/more_advanced_heat_pump_hplib.py:884:24: E0606: Possibly using variable 't_in_secondary_dhw' before assignment (possibly-used-before-assignment)
hisim/components/more_advanced_heat_pump_hplib.py:910:15: E0606: Possibly using variable 'const_thermal_power_truefalse_dhw' before assignment (possibly-used-before-assignment)
hisim/components/more_advanced_heat_pump_hplib.py:911:27: E0606: Possibly using variable 'const_thermal_power_value_dhw' before assignment (possibly-used-before-assignment)
hisim/components/more_advanced_heat_pump_hplib.py:971:27: E0606: Possibly using variable 'p_el_dhw' before assignment (possibly-used-before-assignment)
************* Module hisim.components.weather
hisim/components/weather.py:969:11: E0606: Possibly using variable 'data' before assignment (possibly-used-before-assignment)
************* Module hisim.modular_household.component_connections
hisim/modular_household/component_connections.py:568:5: E0606: Possibly using variable 'heatpump_config' before assignment (possibly-used-before-assignment)
hisim/modular_household/component_connections.py:568:36: E0606: Possibly using variable 'heatpump_l1_config' before assignment (possibly-used-before-assignment)
hisim/modular_household/component_connections.py:776:4: E0606: Possibly using variable 'heatpump_config' before assignment (possibly-used-before-assignment)
hisim/modular_household/component_connections.py:777:4: E0606: Possibly using variable 'heatpump_l1_config' before assignment (possibly-used-before-assignment)
hisim/modular_household/component_connections.py:895:4: E0606: Possibly using variable 'heatpump_config' before assignment (possibly-used-before-assignment)
hisim/modular_household/component_connections.py:896:4: E0606: Possibly using variable 'heatpump_l1_config' before assignment (possibly-used-before-assignment)
************* Module hisim.postprocessing.generate_csv_for_housing_database
hisim/postprocessing/generate_csv_for_housing_database.py:232:28: E0606: Possibly using variable 'day' before assignment (possibly-used-before-assignment)
hisim/postprocessing/generate_csv_for_housing_database.py:233:30: E0606: Possibly using variable 'night' before assignment (possibly-used-before-assignment)
************* Module hisim.postprocessing.investment_cost_co2
hisim/postprocessing/investment_cost_co2.py:92:46: E0606: Possibly using variable 'column' before assignment (possibly-used-before-assignment)
************* Module hisim.postprocessing.opex_and_capex_cost_calculation
hisim/postprocessing/opex_and_capex_cost_calculation.py:124:58: E0606: Possibly using variable 'capex_per_simulated_period' before assignment (possibly-used-before-assignment)
hisim/postprocessing/opex_and_capex_cost_calculation.py:125:63: E0606: Possibly using variable 'device_co2_footprint_per_simulated_period' before assignment (possibly-used-before-assignment)
************* Module hisim.postprocessing.scenario_evaluation.result_data_collection
hisim/postprocessing/scenario_evaluation/result_data_collection.py:647:53: E0606: Possibly using variable 'my_module_config_dict' before assignment (possibly-used-before-assignment)
************* Module hisim.postprocessing.scenario_evaluation.result_data_plotting
hisim/postprocessing/scenario_evaluation/result_data_plotting.py:233:37: E0606: Possibly using variable 'y1_data_variable' before assignment (possibly-used-before-assignment)
hisim/postprocessing/scenario_evaluation/result_data_plotting.py:234:37: E0606: Possibly using variable 'y2_data_variable' before assignment (possibly-used-before-assignment)
hisim/postprocessing/scenario_evaluation/result_data_plotting.py:235:44: E0606: Possibly using variable 'use_y1_as_bottom_for_y2' before assignment (possibly-used-before-assignment)
hisim/postprocessing/scenario_evaluation/result_data_plotting.py:236:52: E0606: Possibly using variable 'sort_according_to_y1_or_y2_data' before assignment (possibly-used-before-assignment)
hisim/postprocessing/scenario_evaluation/result_data_plotting.py:266:42: E0606: Possibly using variable 'line_plot_marker_size' before assignment (possibly-used-before-assignment)
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

No branches or pull requests

1 participant