Version 1.3.0
=============

New features
------------

Apple ARM binaries
^^^^^^^^^^^^^^^^^^
pip and anaconda binaries for apple M processors (python version = 3.11)

C threads
^^^^^^^^^
Introduction of C threads: Starting from version 1.3.0 the :class:`.JetBase` class and all the derived classes, perform the C computation using threads. 
This increase the computational speed Each time you create a new Jet object, you will get a log noticing how many C threads have been created.
The number of threads is automatically determined according to the number of cores and threads of your CPU.
You can revert to single thread, or set a custom number of threads, using the :meth:`.JetBase.set_num_c_threads` and passing the number of threads:

.. code-block:: python

    from jetset.jet_model import Jet
    my_jet=Jet(electron_distribution='lppl')
    
    #to switch back to no threads
    my_jet.set_num_c_threads(1)

    #to use 8 C threads
    my_jet.set_num_c_threads(8)


You can increase or decrease the number of C threads using the same method.
It is not advised to exceed the actual number of threads offered by your CPU, 
since will not increase the speed performance.

Introduction of leptonic synchrotron polarization 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
.. code-block:: python

    from jetset.jet_model import Jet
    my_jet=Jet(electron_distribution='lppl')
    
    nu_range=np.logspace(10,22,50)

    p_nu,nuF_nu=jet.eval_synch_pol(nu_range)
    #p_nu stores the fractional polarization for each frequency  in nu_range


Custom Models
^^^^^^^^^^^^^

- a notebook showing how to implement a galactic expanding shell for (e.g. galactic nova) :ref:`galactic_nova`

- a notebook showing the implementation of a two-zone jet with a compact and extended :ref:`composite_model_two_zones`

Minimizers
^^^^^^^^^^
- Heat map for correlation matrix: added convenience method to plot correlation matrix
- Added ``simplex`` on top of ``migrad`` in ``minuit`` 

MCMC functionalities
^^^^^^^^^^^^^^^^^^^^
- labels setting and bounds have been placed in specific methods
   
  .. code-block:: python

    from jetset.mcmc import McmcSampler
    model_minimizer = ModelMinimizer.load_model('model_minimizer_minuit.pkl')
    mcmc=McmcSampler(model_minimizer)
    
    labels=['N','B','beam_obj','s','gamma0_log_parab']
    model_name='jet_leptonic'
    use_labels_dict={model_name:labels}

    mcmc.set_labels(use_labels_dict=use_labels_dict)

    mcmc.set_bounds(bound=5.0,bound_rel=True)

- added option to plot model and residuals, for the mcmc best fit (obtained setting the pars to their  quantiles=0.5 posterior), instead of the frequentist best-fit model, passing ``plot_mcmc_best_fit_model=True``
    
  .. code-block:: python

     p=mcmc.plot_model(sed_data=sed_data,fit_range=[1E11, 2E27],size=100,quantiles=[0.05,0.95], plot_mcmc_best_fit_model=True)

- customization of lables for plotting

  .. code-block:: python

     mcmc.set_plot_label('N',r'$N$')
     mcmc.set_plot_label('B',r'$B$')
     mcmc.set_plot_label('beam_obj',r'$\delta$')
     mcmc.set_plot_label('s',r'$s$')
     mcmc.set_plot_label('gamma0_log_parab',r'$\gamma_0$')

EBL models
^^^^^^^^^^^^^^^^^^  
- Franceschini et al. (2008) [Franceschini2008]_
  
- Finke et al. (2010) [Finke2010]_ 
  
- Dominguez et al. (2011) [Dominguez2011]_

- Dominguez & Saldana-Lopez (2023) [Dominguez2023]_, [Saldana-Lopez2021]_



EC emission
^^^^^^^^^^^ 
- Improved EC computation for large angles for anisotropic external fields

- Added convenience methods for conical jet and EC fields:
  
  - method :meth:`.JetBase.make_conical_jet` class will set parameters dependencies to have conical jet constraining the blob radius
    
    .. important:: if you use a ``jet`` model with ``R`` depending (i.e. you used :meth:`.JetBase.make_conical_jet`) to perform a temporal evolution (in the :class:`.JetTimeEvol` class), the dependencies on ``R`` will be removed, and to have ``R`` dependent on the position across the jet axis, use the parameter ``beta_exp_R`` in the :class:`.JetTimeEvol` instead. In the next release a more flexible and direct approach will be provided.


  - method :meth:`.JetBase.set_EC_dependencies` class will set parameters dependencies to have scaling relations between BLR and DT radius and disk luminosity




Improved functionalities
^^^^^^^^^^^^^^^^^^^^^^^^
- Improved dependent parameters: handling of astropy units has been improved the functional dependency of the parameters

- Improved serialization: saved models will not break if astropy or numba break their interface in future releases

- Improved functionality to merge light curves :meth:`jetset.jet_timedep.merge_lcs`



bug fixing 
----------
- fixed typo in `EC_components_list` kw in the method :meth:`.ObsConstrain.constrain_SSC_EC_model`
