Giter Site home page Giter Site logo

odym's People

Contributors

carrerf avatar chauenstein avatar leoie3 avatar nheeren avatar noemiejn avatar stefanpauliuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

odym's Issues

Implement Weibull distribution

Hi there,

I want to use a Weibull distribution, but I am not sure how to script it. These are my parameters:

α = shape, β = scale
α = 6.32499, β = 14.3862

I tried to do it like this, but obviously did not work:
image

From Tutorial 6 I saw that Scale and Shape are supposed to be arrays. But what do they need to include? I tried to figure it out with the stats_arrays documentation online but could not find examples for Weibull that helped me.

Thanks again and kind regards !

Use a requirements.txt file

We need a requirements.txt. The current file imports everything. I am not sure what is the purpose of this.

Would you mind if I replaced it with the following, @stefanpauliuk ?
In my case ODYM seems to work with the following (i.e. pip freeze output):

appnope==0.1.0
bleach==2.1.2
cycler==0.10.0
decorator==4.2.1
entrypoints==0.2.3
html5lib==1.0.1
ipykernel==4.8.2
ipython==6.2.1
ipython-genutils==0.2.0
ipywidgets==7.1.2
jedi==0.11.1
Jinja2==2.10
jsonschema==2.6.0
jupyter==1.0.0
jupyter-client==5.2.2
jupyter-console==5.2.0
jupyter-core==4.4.0
MarkupSafe==1.0
matplotlib==2.1.2
mistune==0.8.3
nbconvert==5.3.1
nbformat==4.4.0
notebook==5.4.0
numpy==1.14.1
pandas==0.22.0
pandocfilters==1.4.2
parso==0.1.1
pexpect==4.4.0
pickleshare==0.7.4
prompt-toolkit==1.0.15
ptyprocess==0.5.2
Pygments==2.2.0
pyparsing==2.2.0
python-dateutil==2.6.1
pytz==2018.3
pyzmq==17.0.0
qtconsole==4.3.1
scipy==1.0.0
Send2Trash==1.5.0
simplegeneric==0.8.1
six==1.11.0
terminado==0.8.1
testpath==0.3.1
tornado==4.5.3
tqdm==4.19.6
traitlets==4.3.2
wcwidth==0.1.7
webencodings==0.5.1
widgetsnbextension==3.1.4
xlrd==1.1.0
xlwt==1.3.0

This includes Jupyter. Without that it would be much less dependencies.

Parse Error: Tutorial 6, ParseModelControl

Hi there,

I am trying to understand the MaTrace model, but I get an 'list index out of range' error for ParseModelControl in ODYM_Functions.py when running the Tutorial.

I did not change anything of the file, checked the Config file, but still could not figure it out since the referred cells are definitely defined.

I would be grateful for your help. I would like to use ODYM for a research project and would like to use the Tutorial as a basis.
Thank you very much and all the best.

Bildschirmfoto 2022-02-09 um 14 48 43

Dynamic Stock Model: Negative inflow correction

I have a suspicion that the implementation of the NegativeInflowCorrect in the compute_stock_driven_model() function of the DynamicStockModel is not functioning entirely as intended (link):

My understanding:
Negative inflow occurs when the stock goes down rapidly compared to previous years. In this case the NegativeInflowCorrect flag allows for a more realistic representation where inflow is set to zero. However, to satisfy the stock, the stock by cohort (self.s_c) needs to be adjusted downwards. Essentially representing early retirement. This in turn means that the outflow increases.

The Issue:
In the current code however, it exactly the opposite: the stock by cohort is INcreased, while the outflow by cohort is DEcreased. This means that the prescribed stock is no longer satisfied at each time increment (which I guess should be the case in a stock driven model setting).

Solution (?):
A suggested quick fix would be to switch the operators (+&-) in line 374 & 375 of the DSM. This at least makes sure that the stock is satisfied. It would however not solve the issue of negative outflow (which could in turn be solved by defining the surviving fraction relative to the previous year, or by defining a surplus stock, but that's obviously easier said than done).

Correct application of lifetime model

For dynamic stock modelling we need to solve 3 problems:

  1. Decide on how exactly to move from continuous time to discrete time intervals: Should outflow of inflow of current year already be included
  2. Choose which functions to use: In Scipy and Excel, pdf and cdf have different discretization intervals (pdf(t) is for t +/- 0.5, while cdf(t) is measured at t.)
  3. speedy computation

Requirements.txt

Great project! The tutorials worked well after I installed some extra packages that were not entirely indicated in the Requirements.txt
pandas, openpyxl, pypandoc are needed but not in Requirements.txt

Problem to assign element content after stock-driven model

Hi,

I am doing a stock-driven model for batteries "b" (8 types) but I am struggling to assign the element content "e" (9 elements) for the inflows and outflows afterwards.

I am able to calculate the model and also assign a vehicle "g" (6 types) market share afterwards. Then the outflow (t,g,b) looks as followed (inflow looks the same). The unit is number of batteries/vehicles.
Bildschirmfoto 2022-03-24 um 12 32 22
Bildschirmfoto 2022-03-24 um 12 34 26

Now I want to assign the element content to the flows depending on battery type and vehicle type. My parameter file is a list with the data structure "bge" and "kg" as a unit. However, after assign it, the total number of batteries (in this case shown for the inflow) rises as well:
Bildschirmfoto 2022-03-24 um 12 20 34

I feel like this has something to do with my array Einstein sum of the matrixes, but cannot figure it out. This is my code and I would be thankful if you could help me out.

image

Update of Readme.md with link to publication

Hello,
I randomly found the publication associated with Odym DOI: 10.1111/jiec.12952, maybe time for the dev' team to add it to the readme =) Would for sure help others looking for it.
Kindly,
Elias.

Path of data directory

I corrected the path of the data directory again in commit 1821173 (line 313, 314). However, now I am a bit unsure if it was your intent to have the data directory outside of the model directory, @stefanpauliuk . In my understanding it should become part of it (i.e. be a sub-folder) eventually.

Controlling version use from inside the script

Sometimes modelers may want to not use the latest but a specific version of ODYM, e.g., to recreate specific results for a paper. The easiest way to do that is to switch to a specific commit using a git command.

The question is: Shall we implement an automatic version select option in ODYM?
E.g., with the following prodecure?

  • Model config file contains version number or commit ID that is to be used.
  • Main ODYM script reads this info and via an interface to git selects the requested commit.
  • Script runs with that commit and at the end, the previous commit is reloaded/restored

Waste cascade optimisation

Problem: We have different end-of-life products with product-specific material composition and material-specific elemental content. How should we cascade the different sorting/recovery/recycling technologies to maximise material recovery/minimize costs or GHG emissions in the waste mgt. industries?

Literature leads:

Gaustad, G., E. Olivetti, and R. Kirchain. 2011. Toward Sustainable Material Usage : Evaluating the Importance of Market Motivated Agency in Modeling Material Flows. Environmental Science & Technology 45: 4110–4117.
Kondo, Y. and S. Nakamura. 2005. Waste input–output linear programming model with its application to eco-efficiency analysis. Economic Systems Research 17(4): 393–408. http://www.tandfonline.com/doi/abs/10.1080/09535310500283526. Accessed March 24, 2013.
Løvik, A.N., R. Modaresi, and D.B. Müller. 2014. Long-term strategies for increased recycling of automotive aluminum and its alloying elements. Environmental Science & Technology 48(8): 4257–4265. http://www.ncbi.nlm.nih.gov/pubmed/24655476.
Ohno, H., K. Matsubae, K. Nakajima, Y. Kondo, S. Nakamura, and T. Nagasaka. 2015. Toward the efficient recycling of alloying elements from end of life vehicle steel scrap. Resources, Conservation and Recycling 100: 11–20. http://linkinghub.elsevier.com/retrieve/pii/S0921344915000695. Accessed May 24, 2015.

XLRDError : ODYM Example and Tutorial 3

Hi,

I encountered an issue while following the ODYM Example and Tutorial 3 (see below). Apparently, the xlrd package explicitly dropped support for anything other than xls files.

For the tutorial, an easy fix was simply to export the 'Steel_Lifetime_9Countries.xlsx' as an xls file. However, I wanted to signal the issue in case it has other repercussions on ODYM.

Best regards - and many thanks for publishing and maintaining this repo!

--------------------------------------------------------------------------
XLRDError                                 Traceback (most recent call last)
~/730843896.py in <module>
----> 1 LifetimeFile  = xlrd.open_workbook(os.path.join(DataPath, 'Steel_Lifetime_9Countries.xlsx'))
      2 Datasheet = LifetimeFile.sheet_by_name('Average_Lifetime')
      3 
      4 Lifetimes = []
      5 

~\xlrd\__init__.py in open_workbook(filename, logfile, verbosity, use_mmap, file_contents, encoding_override, formatting_info, on_demand, ragged_rows, ignore_workbook_corruption)
    168     # files that xlrd can parse don't start with the expected signature.
    169     if file_format and file_format != 'xls':
--> 170         raise XLRDError(FILE_FORMAT_DESCRIPTIONS[file_format]+'; not supported')
    171 
    172     bk = open_workbook_xls(

XLRDError: Excel xlsx file; not supported

Deprecated attributes: AttributeError: 'DataFrame' object has no attribute 'ix'

Some attributes are deprecated in current pandas version (1.1.5).

Traceback (most recent call last):
  File ".\main.py", line 149, in <module>
    Dyn_MFA_System.Consistency_Check()
  File ".\Programs\Python\Python39\lib\site-packages\odym\modules\ODYM_Classes.py", line 143, in Consistency_Check
    A = self.IndexTableCheck()
  File ".\Programs\Python\Python39\lib\site-packages\odym\modules\ODYM_Classes.py", line 103, in IndexTableCheck
    if self.IndexTable.ix[indx]['Dimension']  != self.IndexTable.ix[indx]['Classification'].Dimension:
  File ".\Programs\Python\Python39\lib\site-packages\pandas\core\generic.py", line 5141, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'ix'

I found the following fix:
https://stackoverflow.com/questions/59991397/attributeerror-dataframe-object-has-no-attribute-ix

Which version of pandas do you use or recommend to run the odym package with?

#4 indicates pandas 0.22.0, is that still accurate?

Thank you

Add pyproject.toml

Hi,

is it possible to add a pyproject.toml file so odym can be used directly as package?

Thank you!

Logging routine

Revise the logging routine.

@stefanpauliuk What functionalities would you see as important requirements for the logging routine? E.g. is having a HTML output important to you?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.