<commit_before>========
Examples
========

These examples are located in the neuroml/examples directory and can
be tested to confirm they work by running the run_all.py script.

Making a NeuroML morphology
---------------------------

.. literalinclude:: ../neuroml/examples/morphology_generation.py

Loading and modifying a file
----------------------------

.. literalinclude:: ../neuroml/examples/loading_modifying_writing_large.py
 

Building a network
------------------

.. literalinclude:: ../neuroml/examples/build_network.py

Building a 3D network
---------------------

.. literalinclude:: ../neuroml/examples/build_3D_network.py
 
Ion channels
------------

.. literalinclude:: ../neuroml/examples/ion_channel_generation.py

Pynn models
-----------

.. literalinclude:: ../neuroml/examples/write_pynn.py

Synapses
--------

.. literalinclude:: ../neuroml/examples/write_syns.py

Working with arraymorphs
------------------------

.. literalinclude:: ../neuroml/examples/arraymorph_generation.py<commit_msg>added documentation(example of JSON serialization)<commit_after>========
Examples
========

These examples are located in the neuroml/examples directory and can
be tested to confirm they work by running the run_all.py script.

Making a NeuroML morphology
---------------------------

.. literalinclude:: ../neuroml/examples/morphology_generation.py

Loading and modifying a file
----------------------------

.. literalinclude:: ../neuroml/examples/loading_modifying_writing_large.py
 

Building a network
------------------

.. literalinclude:: ../neuroml/examples/build_network.py

Building a 3D network
---------------------

.. literalinclude:: ../neuroml/examples/build_3D_network.py
 
Ion channels
------------

.. literalinclude:: ../neuroml/examples/ion_channel_generation.py

Pynn models
-----------

.. literalinclude:: ../neuroml/examples/write_pynn.py

Synapses
--------

.. literalinclude:: ../neuroml/examples/write_syns.py

Working with JSON serialization
------------------------

One thing to note is that the JSONWriter, unlike NeuroMLWriter, will
serializing using array-based (Arraymorph) representation if this has
been used.

.. literalinclude:: ../neuroml/examples/json_serialization.py


Working with arraymorphs
------------------------

.. literalinclude:: ../neuroml/examples/arraymorph_generation.py
{'fraction_non_alphanumeric': 0.23208191126279865, 'fraction_numerical': 0.0017064846416382253, 'mean_word_length': 2.3404558404558404, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3049037', 'n_tokens_mistral': 693, 'n_tokens_neox': 628, 'n_words': 156}