diff --git a/webpage/faq.py b/webpage/faq.py index 0e52310c..e30afc86 100644 --- a/webpage/faq.py +++ b/webpage/faq.py @@ -1,12 +1,42 @@ faq = {} -faq['What was new in Biogeme 3.2.12?'] = """ +faq[ + 'What was new in Biogeme 3.2.13?' +] = """ +
+
MDCEV
+
The Multiple Discrete Continuous Extreme Value model has been implemented. The code is still experimental, and the documentation is not ready yet. +
+
Local-sensitivy hashing
+
The data reduction method introduced by Ortelli et al. (2023) has been implemented. It has not yet been integrated in the optimization framework.
+
Nests definition
+
The definition of the nests for the nested logit and the cross-nested logit models has been improved, using specific objects. See the module documentation. The calculation of the correlation structure among the alternatives is now performed by those objects, and not anymore by the bioResults object as in previous versions.
+
Sampling of alternatives
+
The methods for the sampling of alternatives have been completely reimplemented. A report with a complete documentation will be available soon.
+
Examples
+
The structure of the examples has been revisited. They are now integrated in the Sphinx documentation, and available both as Python scripts and Jupyter notebooks. Click here.
+
Non convergence
+
The reporting has been improved when the algorithm does not converge.
+
Logging
+
The logging module has been renamed from biogeme.logging into biogeme.biogeme_logging.py. It was necessary because of the ambiguity with the logging module from Python. +
+
File organization
+
Several scripts have bben reorganized into modules. This improves the code readability and should be transparent for the user.
+ + +
+""" +faq[ + 'What was new in Biogeme 3.2.12?' +] = """

This release mainly implements some re-organization of the code and bugs fixes. In particular, the generic optimization algorithms are now distributed in a different package, called biogeme_optimization.

""" -faq['What was new in Biogeme 3.2.11?'] = """ +faq[ + 'What was new in Biogeme 3.2.11?' +] = """
Sampling of alternatives
@@ -43,7 +73,9 @@
""" -faq['What was new in Biogeme 3.2.10?'] = """ +faq[ + 'What was new in Biogeme 3.2.10?' +] = """

Note: versions 3.2.9 and 3.2.10 are identical. Therefore, version 3.2.9 has been removed from the official distribution platform.

@@ -116,7 +148,9 @@ """ -faq['What was new in Biogeme 3.2.8?'] = """ +faq[ + 'What was new in Biogeme 3.2.8?' +] = """

Note that version 3.2.7 and 3.2.8 are almost identical. The description belows compares to version 3.2.6.

@@ -192,7 +226,9 @@ """ -faq['What was new in Biogeme 3.2.6?'] = """ +faq[ + 'What was new in Biogeme 3.2.6?' +] = """
Optimization
New optimization algorithms are @@ -380,7 +416,9 @@

""" -faq['ImportError: DLL load failed while importing cythonbiogeme: The specified module could not be found'] = """ +faq[ + 'ImportError: DLL load failed while importing cythonbiogeme: The specified module could not be found' +] = """ The issue is that in Python 3.8 and older on Windows, DLLs are loaded from trusted locations only (see this). It is necessary to add the path of the DLLs. Here is a way proposed by Facundo Storani, University of Salerno:
  • Search the DLLs folder of anaconda3. It may be similar to: C:\\Users\\[USER_NAME]\\anaconda3\\DLLs or C:\\ProgramData\\Anaconda3\\DLLs.
  • @@ -392,7 +430,9 @@
(credit: Facundo Storani) """ -faq['Why is Cython library not found?'] = """ +faq[ + 'Why is Cython library not found?' +] = """ On Mac OSX, the following error is sometimes generated:
@@ -440,7 +480,9 @@
 If it does not work... I don't know :-(
 """
 
-faq['Why is it trying to compile during installation?'] = """
+faq[
+    'Why is it trying to compile during installation?'
+] = """
 On Mac OSX and Windows, the procedure is designed to install
 from binaries, not sources. If you get messages that look like the
 following, it means that pip is trying to compile from sources. And
diff --git a/webpage/generate.py b/webpage/generate.py
index 9766fef4..087991e0 100644
--- a/webpage/generate.py
+++ b/webpage/generate.py
@@ -14,11 +14,13 @@
 CARD_FILE = 'card.html'
 SPECIAL_FILE = 'special.html'
 
+
 def replace(orig_text, dictionary):
     for k, v in dictionary.items():
         orig_text = orig_text.replace(k, v)
     return orig_text
 
+
 def get_section(content):
     all_html = ''
     id = 0
@@ -58,7 +60,7 @@ def get_special(content):
     all_html = ''
     with open(SPECIAL_FILE, 'r', encoding='utf-8') as f:
         html = f.read()
-    
+
     for special_title, special_content in content.items():
         my_html = html
         replacements = {
@@ -67,7 +69,8 @@ def get_special(content):
         }
         all_html += replace(my_html, replacements)
     return all_html
-        
+
+
 def get_portfolio_grid(doc):
     all_html = ''
     for data, values in doc.items():
@@ -135,7 +138,7 @@ def get_portfolio_modals(doc):
     '__DOC__': get_section(documentation),
     '__RES__': get_section(resources),
     '__ARCHIVES__': get_section(archives),
-    '__SPECIAL__': get_special(special)
+    '__SPECIAL__': get_special(special),
 }
 
 html = replace(html, replacements)
@@ -157,9 +160,9 @@ def get_portfolio_modals(doc):
 # Copy the Bootstrap assets
 shutil.copytree('assets', 'website/assets')
 
-    
+
 # Copy the PythonBiogeme distribution
 shutil.copytree('otherFiles/distrib', 'website/distrib')
 
 # Copy the sphinx documentation
-shutil.copytree('../sphinx/_build/html', 'website/sphinx')
+shutil.copytree('../docs/build/html', 'website/sphinx')
diff --git a/webpage/index.html.orig b/webpage/index.html.orig
index 805f453b..a3d1bf7a 100644
--- a/webpage/index.html.orig
+++ b/webpage/index.html.orig
@@ -5,7 +5,7 @@
     
     
     
-    Biogeme 3.2.12
+    Biogeme 3.2.13
     
     
     
@@ -34,7 +34,7 @@
             
             
             
             
             
@@ -51,7 +51,8 @@
       
Estimating discrete choice models with
-
Biogeme
+
Biogeme
+ Start
@@ -317,7 +318,7 @@
Copyright - © Michel Bierlaire 2022
+ © Michel Bierlaire 2024
+ diff --git a/webpage/js/get_version.js b/webpage/js/get_version.js new file mode 100644 index 00000000..9fa32694 --- /dev/null +++ b/webpage/js/get_version.js @@ -0,0 +1,31 @@ +// This script connects to the pypi.org server and checks the latest available version of Biogeme + +const CACHE_DURATION = 24 * 60 * 60 * 1000; // 1 day in milliseconds + +function fetchVersion() { + fetch('https://pypi.org/pypi/biogeme/json') + .then(response => response.json()) + .then(data => { + const version = data.info.version; + document.getElementById('version').textContent = version; + + // Cache the version and current timestamp + localStorage.setItem('biogemeVersion', version); + localStorage.setItem('biogemeTimestamp', Date.now()); + }) + .catch(error => { + console.error('Error fetching the version:', error); + document.getElementById('version').textContent = 'Error fetching version'; + }); +} + +// Check if we have a cached version and it's still valid +const cachedVersion = localStorage.getItem('biogemeVersion'); +const cachedTimestamp = localStorage.getItem('biogemeTimestamp'); +if (cachedVersion && cachedTimestamp && Date.now() - cachedTimestamp < CACHE_DURATION) { + // Use the cached version + document.getElementById('version').textContent = cachedVersion; +} else { + // Fetch the latest version + fetchVersion(); +} diff --git a/webpage/sections.py b/webpage/sections.py index 27e588d6..4591513a 100644 --- a/webpage/sections.py +++ b/webpage/sections.py @@ -8,12 +8,14 @@ archives = {} resources = {} -#special['Users meeting'] = 'Biogeme users\' meeting, September 5, 2023, Zurich, Switzerland, from 10:00 to 13:00. Click here to register.' -special['EPFL Short Course'] = 'Discrete Choice Analysis: Predicting Individual Behavior and Market Demand. February 11-15, 2024 Click here to register.' -#special['Other special'] = 'Other special as well' +# special['Users meeting'] = 'Biogeme users\' meeting, September 5, 2023, Zurich, Switzerland, from 10:00 to 13:00. Click here to register.' +special[ + 'EPFL Short Course' +] = 'Discrete Choice Analysis: Predicting Individual Behavior and Market Demand. February 11-15, 2024 Click here to register.' +# special['Other special'] = 'Other special as well' about['Biogeme'] = ( -""" + """ Biogeme is a open source Python package designed for the @@ -24,7 +26,7 @@ target="_blank">Python Data Analysis Library called Pandas. """, -""" + """ It is developed and maintained by Prof. Michel Bierlaire, , Ecole Polytechnique Fédérale de Lausanne, Switzerland. """, -""" + """ Biogeme used to be a stand alone software package, written in C++. All the material related to the previous versions of Biogeme are available on the old webpage. -""" +""", ) about['What\'s new in Biogeme 3.2.12?'] = ( -""" + """

In this release, various improvements have been made, including code reorganization and bug fixes. Notably, the generic optimization @@ -53,7 +55,7 @@ ) about['Conditions of use'] = ( -""" + """ BIOGEME is distributed free of charge. We ask each user

  • to register @@ -71,9 +73,9 @@ ) about['Author'] = ( -""" + """ Biogeme has been developed by - Michel Bierlaire, Ecole Polytechnique Fédérale de Lausanne, Switzerland. @@ -82,7 +84,7 @@ about['Acknowledgments'] = ( -""" + """ I would like to thank the following persons who played various roles in the development of Biogeme along the years. The list is certainly not complete, and I apologize for those who are omitted: @@ -94,7 +96,9 @@ John Bates, Denis Bolduc, David Bunch, + Pedro Camargo, Andrew Daly, + Nicolas Dubois, Anna Fernandez Antolin, Mamy Fetiarison, Mogens Fosgerau, @@ -120,31 +124,31 @@ Michael Thémans, Joan Walker. """, -""" + """ I would like to give special thanks to Moshe Ben-Akiva and Daniel McFadden for their friendship, and for the immense influence that they had and still have on my work. -""" +""", ) install['Install Python'] = ( -""" + """ Biogeme is an open source Python package, that relies on the version 3 of Python. Make sure that Python 3.x is installed on your computer. If you have never used Python before, you may want to consider a complete platform such as Anaconda. """, -""" + """ If Python is already installed on your computer, verify the version. Two versions of Python are distributed: version 2 and version 3. Biogeme works only with version 3. -""" +""", ) install['Installing PandasBiogeme on MaxOSX'] = ( -""" + """

    @@ -152,7 +156,7 @@ ) install['Installing Biogeme on Windows'] = ( -""" + """

    @@ -160,7 +164,7 @@ ) install['Install Biogeme from pip'] = ( -""" + """ Biogeme is distributed using the pip package manager. There are several tutorials available on the internet @@ -170,7 +174,7 @@ this one. """, -""" + """ The command to install is simply
     pip install biogeme
    @@ -179,15 +183,15 @@
     )
     
     install['CythonBiogeme on Github'] = (
    -"""
    -A significant part of Biogeme is coded in C++ for the sake of computational efficiciency. Since version 3.2.11, this part of the code has been isolated in a separate package called cythonbiogeme. Binaries for Mac OSX and Windowns are available for versions of Python ranging from 3.7 to 3.11. If, for some reasons, the binary distribution for your system is not available, pip will attempt to compile the package from sources.
    +    """
    +A significant part of Biogeme is coded in C++ for the sake of computational efficiciency. Since version 3.2.11, this part of the code has been isolated in a separate package called cythonbiogeme. Binaries for Mac OSX and Windowns are available for versions of Python ranging from 3.9 to 3.12. If, for some reasons, the binary distribution for your system is not available, pip will attempt to compile the package from sources.
     In that case, it requires a proper
     environment to compile C++ code. In general, it is readily available on Linux, and
     MacOSX (if Xcode has been installed). It may be more
     complicated on Windows.
     """,
    -"""
    +    """
     The source code of CythonBiogeme is available on
     GitHub.
     There are several tutorials available on the internet
    @@ -197,26 +201,26 @@
     this one.
     """,
    -"""
    +    """
     The command to install CythonBiogeme from source is
     
    pip install -ve .
    """, -""" + """ that must be executed in the directory containing the files setup.cfg and setup.py. """, -""" + """ Note that it requires a proper environment to compile C++ code. In general, it is readily available on Linux, and MacOSX (if Xcode has been installed). """, -""" + """ On Windows, here is one possibility.
      -
    1. Install mingw64 from winlibs.com. Download the zip file, and unzip it into c:\mingw64.
    2. -
    3. Add c:\mingw64\\bin in the Windows PATH.
    4. +
    5. Install mingw64 from winlibs.com. Download the zip file, and unzip it into c:\\mingw64.
    6. +
    7. Add c:\\mingw64\\bin in the Windows PATH.
    8. Edit the file setup.cfg and uncomment the lines dedicated to Windows:

      @@ -247,12 +251,12 @@
       
    9. Install using the following command:

      pip install -ve .

    10. -""" +""", ) install['Biogeme on Github'] = ( -""" + """ The source code of Biogeme is available on GitHub. There are several tutorials available on the internet @@ -262,21 +266,21 @@ this one. """, -""" + """ The command to install Biogeme from source is
      pip install -ve .
      """, -""" + """ that must be executed in the directory containing the files setup.cfg and setup.py. """, -""" + """ Note that it does not require to compile C++ code (thanks to CythonBiogeme) and should be working in any environment where Python and CythonBiogeme are properly installed. """, ) install['Check the installation'] = ( -""" + """ To verify if biogeme is correctly installed, you can print the version of Biogeme. To do so, execute the following commands in Python: @@ -286,11 +290,11 @@
The result should look like the following:
-Python 3.11.3 (v3.11.3:f3909b8bc8, Apr  4 2023, 20:12:10) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
+Python 3.12.0 (v3.12.0:0fb18b02c8, Oct  2 2023, 09:45:56) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import biogeme.version as ver
 >>> print(ver.getText())
-biogeme 3.2.12 [2023-08-05]
+biogeme 3.2.13 [2023-12-21]
 Home page: http://biogeme.epfl.ch
 Submit questions to https://groups.google.com/d/forum/biogeme
 Michel Bierlaire, Transport and Mobility Laboratory, Ecole Polytechnique Fédérale de Lausanne (EPFL)
@@ -299,11 +303,11 @@
 )
 
 documentation['Technical reports'] = (
-"""
+    """
 The following technical reports will walk through concrete examples to
 get familiar with the software.
 """,
-"""
+    """