Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/documentation-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@5
with:
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.10'
python-version: '3.11'
- name: Install Pandoc, repo and dependencies
run: |
sudo apt install pandoc
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ossar-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
# Checkout your code repository to scan
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
Code_Consistency:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
- uses: actions/checkout@v5
- uses: astral-sh/ruff-action@v3
- name: Suggestion to fix issues
if: ${{ failure() }}
run: |
Expand All @@ -30,16 +30,16 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
python-version: ['3.11', '3.12', '3.13']
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '[ci skip]')"

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- uses: actions/setup-python@v5
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -67,9 +67,9 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]')"

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- uses: actions/setup-python@v5
- uses: actions/setup-python@v6
with:
python-version: '3.11'

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
python-version: ['3.11', '3.12', '3.13']
if: "!contains(github.event.head_commit.message, '[ci skip]')"

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and build
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- uses: actions/setup-python@v5
- uses: actions/setup-python@v6
with:
python-version: '3.10'
python-version: '3.11'

- name: Install dependencies and build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion Examples/base/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
Subclassing Examples
------------------------

This section gathers examples which correspond to subclassing the :class:`easyscience.Objects.Base.BaseObj` class.
This section gathers examples which correspond to subclassing the :class:`easyscience.base_classes.ObjBase` class.
16 changes: 8 additions & 8 deletions Examples/base/plot_baseclass1.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""
Subclassing BaseObj - Simple Pendulum
Subclassing ObjBase - Simple Pendulum
=====================================
This example shows how to subclass :class:`easyscience.Objects.Base.BaseObj` with parameters from
:class:`EasyScience.Objects.Base.Parameter`. For this example a simple pendulum will be modeled.
This example shows how to subclass :class:`easyscience.base_classes.ObjBase` with parameters from
:class:`EasyScience.variable.Parameter`. For this example a simple pendulum will be modeled.

.. math::
y = A \sin (2 \pi f t + \phi )
Expand All @@ -17,8 +17,8 @@
import matplotlib.pyplot as plt
import numpy as np

from easyscience.Objects.ObjectClasses import BaseObj
from easyscience.Objects.ObjectClasses import Parameter
from easyscience.base_classes import ObjBase
from easyscience.variable import Parameter

# %%
# Subclassing
Expand All @@ -29,7 +29,7 @@
# embedded rST text block:


class Pendulum(BaseObj):
class Pendulum(ObjBase):
def __init__(self, A: Parameter, f: Parameter, p: Parameter):
super(Pendulum, self).__init__('SimplePendulum', A=A, f=f, p=p)

Expand All @@ -41,13 +41,13 @@ def from_pars(cls, A: float = 1, f: float = 1, p: float = 0):
return cls(A, f, p)

def __call__(self, t):
return self.A.raw_value * np.sin(2 * np.pi * self.f.raw_value * t + self.p.raw_value)
return self.A.value * np.sin(2 * np.pi * self.f.value * t + self.p.value)

def plot(self, time, axis=None, **kwargs):
if axis is None:
axis = plt
else:
axis.set_title(f'A={self.A.raw_value}, F={self.f.raw_value}, P={self.p.raw_value}')
axis.set_title(f'A={self.A.value}, F={self.f.value}, P={self.p.value}')
p = axis.plot(time, self(time), **kwargs)
return p

Expand Down
6 changes: 0 additions & 6 deletions Examples/fitting/README.rst

This file was deleted.

22 changes: 0 additions & 22 deletions Examples/fitting/plot_constraints.py

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2024, Easyscience contributors (https://github.com/EasyScience)
Copyright (c) 2025, Easyscience contributors (https://github.com/EasyScience)
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 1 addition & 3 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@

intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
'numpy': ('https://numpy.org/doc/stable/', None),
'pint': ('https://pint.readthedocs.io/en/stable/', None),
'xarray': ('https://xarray.pydata.org/en/stable/', None)
'numpy': ('https://numpy.org/doc/stable/', None)
}

# -- General configuration ---------------------------------------------------
Expand Down
75 changes: 0 additions & 75 deletions docs/src/fitting/constraints.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/src/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Documentation
:maxdepth: 3

fitting/introduction
fitting/constraints

.. toctree::
:maxdepth: 2
Expand Down
23 changes: 5 additions & 18 deletions docs/src/reference/base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Parameters and Objects
Descriptors
===========

.. autoclass:: easyscience.Objects.Variable.Descriptor
.. autoclass:: easyscience.variable.Descriptor
:members:

Parameters
==========

.. autoclass:: easyscience.Objects.Variable.Parameter
.. autoclass:: easyscience.variable.Parameter
:members:
:inherited-members:

Expand All @@ -22,30 +22,17 @@ Super Classes and Collections
Super Classes
=============

.. autoclass:: easyscience.Objects.ObjectClasses.BasedBase
.. autoclass:: easyscience.base_classes.BasedBase
:members:
:inherited-members:

.. autoclass:: easyscience.Objects.ObjectClasses.BaseObj
.. autoclass:: easyscience.base_classes.ObjBase
:members: +_add_component
:inherited-members:

Collections
===========

.. autoclass:: easyscience.Objects.Groups.BaseCollection
.. autoclass:: easyscience.CollectionBase
:members:
:inherited-members:

===============
Data Containers
===============

.. autoclass:: easyscience.Datasets.xarray.EasyScienceDataarrayAccessor
:members:
:inherited-members:

.. autoclass:: easyscience.Datasets.xarray.EasyScienceDatasetAccessor
:members:
:inherited-members:

2 changes: 1 addition & 1 deletion examples_old/example1.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

def fit_fun(x):
# In the real case we would gust call the evaluation fn without reference to the BaseObj
return b.c.raw_value + b.m.raw_value * x
return b.c.value + b.m.value * x


f = Fitter()
Expand Down
2 changes: 1 addition & 1 deletion examples_old/example1_dream.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

def fit_fun(x):
# In the real case we would gust call the evaluation fn without reference to the BaseObj
return b.c.raw_value + b.m.raw_value * x
return b.c.value + b.m.value * x


f = Fitter()
Expand Down
4 changes: 2 additions & 2 deletions examples_old/example2.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def _defaults(self):

@property
def gradient(self):
return self.m.raw_value
return self.m.value

@property
def intercept(self):
return self.c.raw_value
return self.c.value

def fit_func(self, x: np.ndarray) -> np.ndarray:
return self.gradient * x + self.intercept
Expand Down
Loading
Loading