Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
71f9eda
First try Cylinder Magnet, using sympy calculate BZ,BZx,BZxx analytic…
SKeeTElor Apr 7, 2025
3c996c5
All done!
SKeeTElor Apr 9, 2025
ee58012
Just realize that the defination of the elliptic integral is differen…
SKeeTElor Apr 9, 2025
4dfc1ac
Now I manage not to call the number of elliptic function repeatly, ac…
SKeeTElor Apr 14, 2025
4f9f2d0
1
SKeeTElor Apr 14, 2025
830906e
Fix all the bugs in the CylinderMagnet class
SKeeTElor Apr 14, 2025
0e05d2d
1. Use Black formatter to format the code
SKeeTElor Apr 14, 2025
f6e4a17
Modify component docstrings
peterhys Apr 16, 2025
c3c0afa
Complete the CylinderMagnetIndirect class
SKeeTElor Apr 24, 2025
443d328
Now start to implement the approximate calculation of the cylinder ma…
SKeeTElor Apr 24, 2025
f8de1c5
I have add a new component for the cylinder magnet approximation. Als…
SKeeTElor Apr 25, 2025
ee57879
I fixed bug in the polarization function:
SKeeTElor May 8, 2025
a72c617
Fix a typo in the intriduction part of magnet files
SKeeTElor Jun 7, 2025
9277285
Create cermittd_fast.py
SKeeTElor Jun 7, 2025
cb6b3d4
Add notes for the test cases of CylinderMagnet and CylinderMagnetAppr…
SKeeTElor Jun 24, 2025
df947fd
Fix a bug in the polarization formula: rel_dpol_sat_td. It constantly…
SKeeTElor Jul 2, 2025
bd92447
Add docstring in test file of CylinderMagnet ans CylinderMagnetApprox…
SKeeTElor Aug 20, 2025
18ecfcb
Add CylinderMagnetApproxByRect to path
SKeeTElor Aug 20, 2025
cd3909e
Delete 1.0.0
peterhys Oct 24, 2025
d01cac1
Add CylinderMagnetApproxByRect to path
SKeeTElor Aug 20, 2025
c592a81
Merge branch 'FastCermitted' of https://github.com/Marohn-Group/mrfms…
SKeeTElor Oct 24, 2025
2d49802
Fromat the docstring of CylinderMagnet
SKeeTElor Oct 24, 2025
31d807c
Delete CylinderMagnet
SKeeTElor Oct 24, 2025
8edd064
Merge branch 'FastCermitted' into CylinderMagnet
SKeeTElor Oct 24, 2025
9032701
Modulate the test of CylinderMagnetApproxByRect
SKeeTElor Oct 24, 2025
f85a143
Merge pull request #5 from SKeeTElor/CylinderMagnet
SKeeTElor Oct 24, 2025
bde2e03
Refactor cylinder magnet class
peterhys Oct 24, 2025
f068021
Refactor time dependent polarization test
peterhys Oct 24, 2025
8828157
Add cylindermagnet module in magnet documentation
peterhys Oct 24, 2025
47bf20a
Delete cermittd_fast.py and add polarization.py
SKeeTElor Oct 24, 2025
f9c7a51
Merge branch 'Marohn-Group:main' into CylinderMagnet
SKeeTElor Oct 24, 2025
6cf9998
Merge branch 'CylinderMagnet' of https://github.com/SKeeTElor/mrfmsim…
SKeeTElor Oct 24, 2025
12914e9
Fix the bug in the test
SKeeTElor Oct 25, 2025
7d54546
Fix 3 new bugs in test
SKeeTElor Oct 25, 2025
f8142a5
fix docstring format
SKeeTElor Oct 25, 2025
833ce29
Fix cylinder magnet and tests docstring
peterhys Oct 29, 2025
678d5af
Add issue templates
peterhys Oct 30, 2025
fd79a9a
Add contribution guidelines
peterhys Oct 30, 2025
7958099
Add formatter guideline
peterhys Oct 30, 2025
934e775
Merge branch 'develop-0.3.1' into pr/4
peterhys Oct 30, 2025
eacbef4
Remove sympy
peterhys Oct 30, 2025
9c5966f
Adjust the td cermit polarization behavior
peterhys Oct 30, 2025
e5ce9d1
Revert the changes to magnet.py
peterhys Oct 30, 2025
44ef7bf
Merge pull request #4 from SKeeTElor/CylinderMagnet
peterhys Oct 30, 2025
992fc16
Documentation and docstring format change
peterhys Oct 30, 2025
f35b214
Update feature_request.md
peterhys Oct 30, 2025
1b771db
Update templates
peterhys Oct 30, 2025
04b5ed7
Change mmodel version requirement
peterhys Oct 31, 2025
c5ece97
Merge branch 'main' into develop-0.3.1
peterhys Oct 31, 2025
4fdcf29
Update CHANGELOG.rst
peterhys Oct 31, 2025
7866641
Change to auto numbered footnote
peterhys Oct 31, 2025
0c0c9de
Update docstring and documentation
peterhys Oct 31, 2025
8958768
Add boundary nan value checks
peterhys Oct 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ assignees: ''

<!-- Please complete the following information -->

- **OS:** [e.g., macOS 13.0, Ubuntu 22.04, Windows 11]
- **OS:** [e.g., macOS 26.0, Ubuntu 22.04, Windows 11]
- **Python Version:** [e.g., 3.9.7, 3.10.5]
- **mrfmsim Version:** [e.g., 0.1.0, or commit hash if installed from source]
- **mrfmsim Version:** [e.g., 0.1.0]
- **Installation Method:** [e.g., pip, conda, from source]

## Error Messages/Stack Traces
Expand All @@ -54,4 +54,5 @@ Paste error message here

## Possible Solution

<!-- If you have suggestions on how to fix the bug, please share them here -->
<!-- If you have suggestions on how to fix the bug,
please share them here -->
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ assignees: ''

## Additional Context

<!-- Add any other context, examples, or screenshots about the documentation issue here -->


<!-- Add any other context, examples,
or screenshots about the documentation issue here -->
9 changes: 4 additions & 5 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ assignees: ''

## Additional Context

<!-- Add any other context, screenshots, code examples, or references about the feature request here -->
<!-- Add any other context, screenshots, code examples,
or references about the feature request here -->

## Potential Implementation

<!-- If you have ideas about how this could be implemented, please share them here -->



<!-- If you have ideas about how this could be implemented,
please share them here -->
55 changes: 21 additions & 34 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## Description

<!-- Provide a clear and concise description of your changes -->

## Changes Made

<!-- List the key changes made in this PR -->

-
-
-

## Type of Pull Request

<!-- Check the appropriate box by replacing [ ] with [x] -->
Expand All @@ -11,36 +23,24 @@
- [ ] Test coverage improvement
- [ ] Other (please describe):

## Description

<!-- Provide a clear and concise description of your changes -->


## Related Issue(s)

<!-- Link to related issue(s) if applicable -->
<!-- Example: Fixes #123, Closes #456, Related to #789 -->


## Changes Made

<!-- List the key changes made in this PR -->

-
-
-

## Breaking Changes

<!-- If this PR introduces breaking changes, describe them here -->
<!-- Otherwise, write "None" -->


## Testing Performed
## Testing

<!-- Describe the testing you have performed to verify your changes -->

- [ ] All existing tests pass (`tox` or `pytest`)
- [ ] All existing tests pass (`tox`)
- [ ] Added new tests for new functionality
- [ ] Manual testing performed (describe below)

Expand All @@ -58,31 +58,18 @@
- [ ] Added usage examples (if applicable)
- [ ] Documentation builds without errors (`cd docs && make html`)

## Code Quality
## Checklist

<!-- Check all that apply -->

- [ ] Code follows PEP 8 style guidelines
- [ ] Code follows PEP 8 style guidelines (use ``Black`` formatter's default settings)
- [ ] Used meaningful variable and function names
- [ ] Code is modular and readable

## Checklist

<!-- Check all that apply -->

- [ ] My code follows the project's coding standards
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] My changes generate no new warnings or errors
- [ ] I have checked that this PR focuses on a single feature or bug fix
- [ ] Commented code, particularly in hard-to-understand areas
- [ ] Changes generate no new warnings or errors
- [ ] PR focuses on a single feature or bug fix

## Additional Notes

<!-- Any additional information that reviewers should know -->


## Screenshots (if applicable)

<!-- Add screenshots here if relevant -->


<!-- Any additional information that reviewers should know
Add screenshots here if relevant -->
10 changes: 9 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@ and this project adheres to
[unreleased]
------------

Minor fixes to documentation.
Added Cylinder Magnet and minor fixes to docstrings and documentation.

Changed
^^^^^^^

- Change the CERMITD experiment graph to avoid output duplication.
- Change the API to use the latest version of the mmodel package (0.9.0).
- Modify the Nan treatment of ``polarization.rel_dpol_sat_td`` (#4)
- Reformat the docstrings and documentations

Added
^^^^^

- Add ``CylinderMagnetApprox`` class to approximate the magnetic field of a cylinder magnet (#4)
- Add pull request and issue templates.

[0.3.0] - 2025-02-25
----------------------
Expand Down
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ To test in different environments::
tox


Contributing
^^^^^^^^^^^^

We welcome contributions! Please see our `Contributing Guide <docs/contribute.rst>`_ for details on how to follow our development guidelines and submit pull requests.

.. rubric:: References

.. [#Sidles1995jan] Sidles, J. A.; Garbini, J. J.; Bruland, K. J.; Rugar, D.;
Expand Down
4 changes: 2 additions & 2 deletions docs/basic/geometry.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Experiment geometry
=============================

For experiments in the *mrfmsim*, two experimental geometry
For experiments in the *mrfmsim*, two experimental geometries
are used: "hangdown" and SPAM (springiness preservation by aligning magnetization).
The two geometry are shown in the figure below.
The two geometries are shown in the figure below.

.. image:: ../_static/mrfm-setups.pdf
:width: 800px
Expand Down
2 changes: 1 addition & 1 deletion docs/basic/inheritance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ ExperimentGroup
----------------

The ``mrfmsim.group.ExperimentGroup`` class adds additional properties
``epxeriments`` and ``epxeriment_defaults`` alongside the parent class's
``experiments`` and ``experiment_defaults`` alongside the parent class's
``models`` and ``model_defaults`` properties.
4 changes: 2 additions & 2 deletions docs/basic/plugin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Ancillary features are added to the mrfmsim ecosystem through plugin packages.
The separation of the core functionality and the plugins allows for an easy maintenance
of the mrfmsim package. The core functionalities do not depend on the plugins.

mrfmsim-ymal: YAML configuration plugin
mrfmsim-yaml: YAML configuration plugin
---------------------------------------

mrfmsim classes can be fully defined using YAML configuration files. The plugin
creates a ``MrfmSimLoader`` and a ``MrfmSimDumper`` that can be used to load and
dump the mrfmsim classes to and from YAML files. For detailed usage of the package
see the `mrfmsim-ymal <https://github.com/Marohn-Group/mrfmsim-yaml>`_.
see the `mrfmsim-yaml <https://github.com/Marohn-Group/mrfmsim-yaml>`_.

To define an experiment or experiment group with YAML files, the available tags are:
"!func", "!import", "!nodes", "!Graph", "!Experiment", and "!ExperimentGroup".
Expand Down
158 changes: 158 additions & 0 deletions docs/contribute.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
Contribute
========================

We welcome contributions to mrfmsim! This guide will help you get started.

Getting Started
---------------

1. **Fork the Repository**

Fork the mrfmsim repository on GitHub and clone your fork locally:

.. code-block:: bash

git clone https://github.com/Marohn-Group/mrfmsim.git
cd mrfmsim


2. **Create a Branch**

Create a new branch for your feature or bug fix:

.. code-block:: bash

git checkout -b feature/your-branch-name

Development Guidelines
----------------------

Code Style
~~~~~~~~~~

- Follow PEP 8 style guidelines for Python code (use ``Black`` formatter's default settings)
- Use meaningful variable and function names
- Keep functions focused and modular
- Add type hints where appropriate

Documentation
~~~~~~~~~~~~~

- Write clear docstrings for all public classes, methods, and functions
- Use reStructuredText (reST) format for docstrings
- Refer to the `Sphinx docstring guide <https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html>`__ for detailed formatting information
- Include:

- Brief description of what the function/class does
- Parameter descriptions with types and units in **Sphinx** docstring format
- Return value description
- Usage examples where helpful
- Mathematical formulas using Sphinx math directive when relevant

Example docstring format:

.. code-block:: python

def example_method(x, y, z):
r"""Calculate some property.

Brief description of what this method does and any important
details about the calculation or algorithm.

:param float x: :math:`x` coordinate [nm]
:param float y: :math:`y` coordinate [nm]
:param float z: :math:`z` coordinate [nm]
:return: calculated value
:rtype: float
"""
pass


Building Documentation
----------------------

To build the documentation locally:

.. code-block:: bash

cd docs
make html

The built documentation will be in ``docs/_build/html/``.

Testing
~~~~~~~

- Write tests for all new features and bug fixes
- Tests should be fast and independent from one another
- Ensure all tests pass before submitting a pull request
- Aim for good test coverage of your code

Install test dependencies:

.. code-block:: bash

pip install ".[test]"

Run tests with tox:

.. code-block:: bash

tox

This will run tests across multiple Python environments and check code coverage.


Submitting a Pull Request
--------------------------

**Important**: Each pull request should focus on a single feature or bug fix. This makes the code easier to review, test, and maintain.

1. **Push to Your Fork**

.. code-block:: bash

git push origin feature/your-feature-name

2. **Create Pull Request**

- Go to the mrfmsim repository on GitHub
- Click "New Pull Request"
- Select your fork and the ``develop`` branch as the base branch
- Fill out the pull request template with:

- Type of pull request (bug fix, feature, documentation, etc.)
- Description of changes
- Related issue numbers (if applicable)
- Any breaking changes
- Testing performed

3. **Review Process**

- Maintainers will review your pull request
- Address any feedback or requested changes
- Once approved, your changes will be merged


Reporting Issues
----------------

When reporting issues, please include:

- A clear description of the problem
- Steps to reproduce the issue
- Expected vs. actual behavior
- Your environment (Python version, OS, etc.)
- Any relevant error messages or stack traces

Questions?
----------

If you have questions about contributing, feel free to:

- Open an issue on GitHub
- Check existing documentation
- Reach out to the maintainers

Thank you for contributing to mrfmsim!

2 changes: 1 addition & 1 deletion docs/experiment/CermitSat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ in the Table below.
======================================== =================================================

Variables appearing in eqs. :eq:`eq:x`, :eq:`eq:x-vars`, and subsequent equations.
he magnetic field :math:`B_0` is applied along the :math:`z` axis,
The magnetic field :math:`B_0` is applied along the :math:`z` axis,
and the equilibrium magnetization :math:`M_0` also lies along the :math:`z` axis.

Steady-state solution
Expand Down
2 changes: 1 addition & 1 deletion docs/experiment/CermitSingleSpin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Overview
--------

The experiments calculate the effective force on a cantilever from a single electron spin located directly below a magnet-tipped cantilever in the "hangdown" and SPAM geometries.
There are two experiments in the group: cantilever spin constant shift calculated using the Trapezoid rule ("CermitSingleSpinApprox"), and cantilever spring constant shift calculated directly using elliptic integrals ("CermitSingleSpin").
There are two experiments in the group: cantilever spring constant shift calculated using the Trapezoid rule ("CermitSingleSpinApprox"), and cantilever spring constant shift calculated directly using elliptic integrals ("CermitSingleSpin").
The exact solution only works for spin directly under a **spherical** magnet. The experiments are adopted from Section 3.5 of Eric Moore's dissertation. [#Moore2011Sep]_


Expand Down
2 changes: 1 addition & 1 deletion docs/experiment/CermitTD.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ At low-:math:`B_1` region, we can determine numerically the final magnetization
.. math::
:label: eq:Mz(tau0)

M_z^\mathrm{finial}
M_z^\mathrm{final}
\approx e^{-R(\tau_i, \tau_f)} M_z^\mathrm{initial}


Expand Down
Loading