Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def create_LcoptModel_from_BW2Package(import_filename, autosetup=True):
import_data = BW2Package.load_file(import_filename)
orig_db = import_data[0]['data']
db_name = import_data[0]['name']
model = LcoptModel(db_name, autosetup=autosetup)
db = deepcopy(orig_db)
temp_param_set = []
temp_production_param_set = []
for k, v in db.items():
exchanges = []
production_amount = v.get('production amount', 1)
if production_amount != 1:
print("NOTE: Production amount for {} is not 1 unit ({})".format(v['name'], production_amount, production_amount))
temp_production_param_set.append({'of': v['name'], 'amount': production_amount})